aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/lib/active_job/queue_adapter.rb
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@squareup.com>2014-09-23 21:11:54 -0700
committerTamir Duberstein <tamird@squareup.com>2015-02-23 17:31:36 -0800
commit802f855ecf95d36982482182adcb007d505e2178 (patch)
treea4da9e398d586de86d24cd22997652336ebacb82 /activejob/lib/active_job/queue_adapter.rb
parent88b334ec696ffe1fa08b934780f4ab27030c5c76 (diff)
downloadrails-802f855ecf95d36982482182adcb007d505e2178.tar.gz
rails-802f855ecf95d36982482182adcb007d505e2178.tar.bz2
rails-802f855ecf95d36982482182adcb007d505e2178.zip
`ActiveJob::QueueAdapters::TestAdapter` is now a singleton
Since `ActiveJob::TestHelper` globally sets `ActiveJob::Base.queue_adapter` on setup, there is no benefit in instantiating a new `TestAdapter` per tests. The original rationale was to allow parallel tests to run without interference, but since they'd all mutate the global `ActiveJob::Base.queue_adapter`, that was never realized.
Diffstat (limited to 'activejob/lib/active_job/queue_adapter.rb')
-rw-r--r--activejob/lib/active_job/queue_adapter.rb2
1 files changed, 0 insertions, 2 deletions
diff --git a/activejob/lib/active_job/queue_adapter.rb b/activejob/lib/active_job/queue_adapter.rb
index d610d30e01..aa3ebdbc7b 100644
--- a/activejob/lib/active_job/queue_adapter.rb
+++ b/activejob/lib/active_job/queue_adapter.rb
@@ -17,8 +17,6 @@ module ActiveJob
def queue_adapter=(name_or_adapter)
@@queue_adapter = \
case name_or_adapter
- when :test
- ActiveJob::QueueAdapters::TestAdapter.new
when Symbol, String
load_adapter(name_or_adapter)
else