aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/jobs
diff options
context:
space:
mode:
authorCristian Bica <cristian.bica@gmail.com>2014-08-16 00:02:06 +0300
committerCristian Bica <cristian.bica@gmail.com>2014-08-16 00:02:06 +0300
commit788aee5acf195d55914e086540f907d9291e9d24 (patch)
tree614c906eeb3f5eaec9d4ac170d105445b7fc5b73 /activejob/test/jobs
parentc2f1eca19409cbbe72bf89b2087b212341201aa1 (diff)
downloadrails-788aee5acf195d55914e086540f907d9291e9d24.tar.gz
rails-788aee5acf195d55914e086540f907d9291e9d24.tar.bz2
rails-788aee5acf195d55914e086540f907d9291e9d24.zip
Moved AR testing from using global variable to thread variable
Diffstat (limited to 'activejob/test/jobs')
-rw-r--r--activejob/test/jobs/gid_job.rb4
-rw-r--r--activejob/test/jobs/hello_job.rb2
-rw-r--r--activejob/test/jobs/rescue_job.rb4
3 files changed, 5 insertions, 5 deletions
diff --git a/activejob/test/jobs/gid_job.rb b/activejob/test/jobs/gid_job.rb
index c69e38d3cc..eeb34c8a87 100644
--- a/activejob/test/jobs/gid_job.rb
+++ b/activejob/test/jobs/gid_job.rb
@@ -1,6 +1,6 @@
class GidJob < ActiveJob::Base
def perform(person)
- $BUFFER << "Person with ID: #{person.id}"
+ Thread.current[:ajbuffer] << "Person with ID: #{person.id}"
end
end
- \ No newline at end of file
+
diff --git a/activejob/test/jobs/hello_job.rb b/activejob/test/jobs/hello_job.rb
index 25441dd0c8..cb067bbe69 100644
--- a/activejob/test/jobs/hello_job.rb
+++ b/activejob/test/jobs/hello_job.rb
@@ -1,5 +1,5 @@
class HelloJob < ActiveJob::Base
def perform(greeter = "David")
- $BUFFER << "#{greeter} says hello"
+ Thread.current[:ajbuffer] << "#{greeter} says hello"
end
end
diff --git a/activejob/test/jobs/rescue_job.rb b/activejob/test/jobs/rescue_job.rb
index acf2b81515..e42de4876e 100644
--- a/activejob/test/jobs/rescue_job.rb
+++ b/activejob/test/jobs/rescue_job.rb
@@ -2,7 +2,7 @@ class RescueJob < ActiveJob::Base
class OtherError < StandardError; end
rescue_from(ArgumentError) do
- $BUFFER << "rescued from ArgumentError"
+ Thread.current[:ajbuffer] << "rescued from ArgumentError"
arguments[0] = "DIFFERENT!"
retry_now
end
@@ -14,7 +14,7 @@ class RescueJob < ActiveJob::Base
when "other"
raise OtherError
else
- $BUFFER << "performed beautifully"
+ Thread.current[:ajbuffer] << "performed beautifully"
end
end
end