aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/jobs/rescue_job.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/test/jobs/rescue_job.rb')
-rw-r--r--activejob/test/jobs/rescue_job.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/activejob/test/jobs/rescue_job.rb b/activejob/test/jobs/rescue_job.rb
index 4f6376c850..d142cec1ea 100644
--- a/activejob/test/jobs/rescue_job.rb
+++ b/activejob/test/jobs/rescue_job.rb
@@ -1,16 +1,18 @@
-require_relative '../support/job_buffer'
+# frozen_string_literal: true
+
+require_relative "../support/job_buffer"
class RescueJob < ActiveJob::Base
class OtherError < StandardError; end
rescue_from(ArgumentError) do
- JobBuffer.add('rescued from ArgumentError')
+ JobBuffer.add("rescued from ArgumentError")
arguments[0] = "DIFFERENT!"
retry_job
end
rescue_from(ActiveJob::DeserializationError) do |e|
- JobBuffer.add('rescued from DeserializationError')
+ JobBuffer.add("rescued from DeserializationError")
JobBuffer.add("DeserializationError original exception was #{e.cause.class.name}")
end
@@ -19,9 +21,9 @@ class RescueJob < ActiveJob::Base
when "david"
raise ArgumentError, "Hair too good"
when "other"
- raise OtherError
+ raise OtherError, "Bad hair"
else
- JobBuffer.add('performed beautifully')
+ JobBuffer.add("performed beautifully")
end
end
end