diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2016-08-01 16:09:16 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2016-08-01 16:09:16 -0700 |
commit | 08a92d47b08b25356b8bfea31c91ceb68cfae3ee (patch) | |
tree | c3f80b0d46c635af21efedd5ce01542e4e6fb1ee /activejob/test/cases | |
parent | a4fc7dc9577cb6476d8f11682cb5b853149c23fc (diff) | |
download | rails-08a92d47b08b25356b8bfea31c91ceb68cfae3ee.tar.gz rails-08a92d47b08b25356b8bfea31c91ceb68cfae3ee.tar.bz2 rails-08a92d47b08b25356b8bfea31c91ceb68cfae3ee.zip |
Use descriptive exception names
Diffstat (limited to 'activejob/test/cases')
-rw-r--r-- | activejob/test/cases/exceptions_test.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/activejob/test/cases/exceptions_test.rb b/activejob/test/cases/exceptions_test.rb index b120a580fa..f6ca528362 100644 --- a/activejob/test/cases/exceptions_test.rb +++ b/activejob/test/cases/exceptions_test.rb @@ -7,41 +7,41 @@ class ExceptionsTest < ActiveSupport::TestCase end test "successfully retry job throwing exception against defaults" do - RetryJob.perform_later 'SeriousError', 5 + RetryJob.perform_later 'DefaultsError', 5 assert_equal [ - "Raised SeriousError for the 1st time", - "Raised SeriousError for the 2nd time", - "Raised SeriousError for the 3rd time", - "Raised SeriousError for the 4th time", + "Raised DefaultsError for the 1st time", + "Raised DefaultsError for the 2nd time", + "Raised DefaultsError for the 3rd time", + "Raised DefaultsError for the 4th time", "Successfully completed job" ], JobBuffer.values end test "successfully retry job throwing exception against higher limit" do - RetryJob.perform_later 'VerySeriousError', 9 + RetryJob.perform_later 'ShortWaitTenAttemptsError', 9 assert_equal 9, JobBuffer.values.count end test "failed retry job when exception kept occurring against defaults" do begin - RetryJob.perform_later 'SeriousError', 6 - assert_equal "Raised SeriousError for the 5th time", JobBuffer.last_value - rescue SeriousError + RetryJob.perform_later 'DefaultsError', 6 + assert_equal "Raised DefaultsError for the 5th time", JobBuffer.last_value + rescue DefaultsError pass end end test "failed retry job when exception kept occurring against higher limit" do begin - RetryJob.perform_later 'VerySeriousError', 11 - assert_equal "Raised VerySeriousError for the 10th time", JobBuffer.last_value - rescue VerySeriousError + RetryJob.perform_later 'ShortWaitTenAttemptsError', 11 + assert_equal "Raised ShortWaitTenAttemptsError for the 10th time", JobBuffer.last_value + rescue ShortWaitTenAttemptsError pass end end test "discard job" do - RetryJob.perform_later 'NotSeriousError', 2 - assert_equal "Raised NotSeriousError for the 1st time", JobBuffer.last_value + RetryJob.perform_later 'DiscardableError', 2 + assert_equal "Raised DiscardableError for the 1st time", JobBuffer.last_value end end |