File tree Expand file tree Collapse file tree 2 files changed +0
-16
lines changed Expand file tree Collapse file tree 2 files changed +0
-16
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,6 @@ def active_job_message
150
150
# }
151
151
#
152
152
def self . load_from_hash hash
153
- return [ ] unless hash . is_a? ( Hash )
154
153
array = hash . inject ( [ ] ) do |out , ( key , job ) |
155
154
job [ 'name' ] = key
156
155
out << job
@@ -161,7 +160,6 @@ def self.load_from_hash hash
161
160
# like to {#load_from_hash}
162
161
# If exists old jobs in redis but removed from args, destroy old jobs
163
162
def self . load_from_hash! hash
164
- return [ ] unless hash . is_a? ( Hash )
165
163
destroy_removed_jobs ( hash . keys )
166
164
load_from_hash ( hash )
167
165
end
Original file line number Diff line number Diff line change 955
955
assert_equal out . size , 0 , "should have no errors"
956
956
assert_equal Sidekiq ::Cron ::Job . all . size , 2 , "Should have 2 jobs after load"
957
957
end
958
-
959
- describe 'errors' do
960
- describe 'not a hash' do
961
- before do
962
- @jobs_hash = YAML . load_file ( '/dev/null' ) # => false
963
- end
964
-
965
- it 'do not create jobs and do not fail' do
966
- assert_equal Sidekiq ::Cron ::Job . all . size , 0 , "Should have 0 jobs before load"
967
- out = Sidekiq ::Cron ::Job . load_from_hash! @jobs_hash
968
- assert_equal out . size , 0 , "should have no errors"
969
- end
970
- end
971
- end
972
958
end
973
959
974
960
describe "from array" do
You can’t perform that action at this time.
0 commit comments