test/test_workers.rb in sidekiq-expected_failures-0.0.1 vs test/test_workers.rb in sidekiq-expected_failures-0.2.0
- old
+ new
@@ -6,12 +6,21 @@
include ::Sidekiq::Worker
end
class SingleExceptionWorker
include ::Sidekiq::Worker
- sidekiq_options expected_failures: [ZeroDivisionError]
+ sidekiq_options expected_failures: { ZeroDivisionError => nil }
end
class MultipleExceptionWorker
include ::Sidekiq::Worker
- sidekiq_options expected_failures: [NotImplementedError, VeryOwn::CustomException]
+ sidekiq_options expected_failures: { NotImplementedError => nil, VeryOwn::CustomException => nil }
+end
+
+class CustomizedWorker
+ include ::Sidekiq::Worker
+ sidekiq_options expected_failures: {
+ NotImplementedError => nil,
+ VeryOwn::CustomException => [10, 20, 50],
+ ZeroDivisionError => 5
+ }
end