aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/cases/exceptions_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:41:18 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:41:18 +0200
commitbde6547bb6a8ddf18fb687bf20893d3dc87e0358 (patch)
tree549bb6e0b876050f688453aaae9d3e03d65e0a34 /activejob/test/cases/exceptions_test.rb
parent93c9534c9871d4adad4bc33b5edc355672b59c61 (diff)
downloadrails-bde6547bb6a8ddf18fb687bf20893d3dc87e0358.tar.gz
rails-bde6547bb6a8ddf18fb687bf20893d3dc87e0358.tar.bz2
rails-bde6547bb6a8ddf18fb687bf20893d3dc87e0358.zip
applies new string literal convention in activejob/test
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'activejob/test/cases/exceptions_test.rb')
-rw-r--r--activejob/test/cases/exceptions_test.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/activejob/test/cases/exceptions_test.rb b/activejob/test/cases/exceptions_test.rb
index 58d87a339a..004e9f4305 100644
--- a/activejob/test/cases/exceptions_test.rb
+++ b/activejob/test/cases/exceptions_test.rb
@@ -1,5 +1,5 @@
-require 'helper'
-require 'jobs/retry_job'
+require "helper"
+require "jobs/retry_job"
class ExceptionsTest < ActiveJob::TestCase
setup do
@@ -9,7 +9,7 @@ class ExceptionsTest < ActiveJob::TestCase
test "successfully retry job throwing exception against defaults" do
perform_enqueued_jobs do
- RetryJob.perform_later 'DefaultsError', 5
+ RetryJob.perform_later "DefaultsError", 5
assert_equal [
"Raised DefaultsError for the 1st time",
@@ -22,7 +22,7 @@ class ExceptionsTest < ActiveJob::TestCase
test "successfully retry job throwing exception against higher limit" do
perform_enqueued_jobs do
- RetryJob.perform_later 'ShortWaitTenAttemptsError', 9
+ RetryJob.perform_later "ShortWaitTenAttemptsError", 9
assert_equal 9, JobBuffer.values.count
end
end
@@ -30,7 +30,7 @@ class ExceptionsTest < ActiveJob::TestCase
test "failed retry job when exception kept occurring against defaults" do
perform_enqueued_jobs do
begin
- RetryJob.perform_later 'DefaultsError', 6
+ RetryJob.perform_later "DefaultsError", 6
assert_equal "Raised DefaultsError for the 5th time", JobBuffer.last_value
rescue DefaultsError
pass
@@ -41,7 +41,7 @@ class ExceptionsTest < ActiveJob::TestCase
test "failed retry job when exception kept occurring against higher limit" do
perform_enqueued_jobs do
begin
- RetryJob.perform_later 'ShortWaitTenAttemptsError', 11
+ RetryJob.perform_later "ShortWaitTenAttemptsError", 11
assert_equal "Raised ShortWaitTenAttemptsError for the 10th time", JobBuffer.last_value
rescue ShortWaitTenAttemptsError
pass
@@ -51,14 +51,14 @@ class ExceptionsTest < ActiveJob::TestCase
test "discard job" do
perform_enqueued_jobs do
- RetryJob.perform_later 'DiscardableError', 2
+ RetryJob.perform_later "DiscardableError", 2
assert_equal "Raised DiscardableError for the 1st time", JobBuffer.last_value
end
end
test "custom handling of job that exceeds retry attempts" do
perform_enqueued_jobs do
- RetryJob.perform_later 'CustomCatchError', 6
+ RetryJob.perform_later "CustomCatchError", 6
assert_equal "Dealt with a job that failed to retry in a custom way", JobBuffer.last_value
end
end
@@ -68,7 +68,7 @@ class ExceptionsTest < ActiveJob::TestCase
perform_enqueued_jobs do
assert_performed_with at: (Time.now + 3600.seconds).to_i do
- RetryJob.perform_later 'LongWaitError', 5
+ RetryJob.perform_later "LongWaitError", 5
end
end
end
@@ -81,7 +81,7 @@ class ExceptionsTest < ActiveJob::TestCase
assert_performed_with at: (Time.now + 18.seconds).to_i do
assert_performed_with at: (Time.now + 83.seconds).to_i do
assert_performed_with at: (Time.now + 258.seconds).to_i do
- RetryJob.perform_later 'ExponentialWaitTenAttemptsError', 5
+ RetryJob.perform_later "ExponentialWaitTenAttemptsError", 5
end
end
end
@@ -97,7 +97,7 @@ class ExceptionsTest < ActiveJob::TestCase
assert_performed_with at: (Time.now + 4.seconds).to_i do
assert_performed_with at: (Time.now + 6.seconds).to_i do
assert_performed_with at: (Time.now + 8.seconds).to_i do
- RetryJob.perform_later 'CustomWaitTenAttemptsError', 5
+ RetryJob.perform_later "CustomWaitTenAttemptsError", 5
end
end
end