1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Define a SynchronousQueue for test in Action Pack.

We don't need to rely on rails/queueing in Action Pack tests
This commit is contained in:
Rafael Mendonça França 2012-09-12 15:25:04 -03:00
parent 45537f00b4
commit d0c25f253f
2 changed files with 10 additions and 6 deletions

View file

@ -26,7 +26,6 @@ require 'active_model'
require 'active_record'
require 'action_controller/caching'
require 'action_controller/caching/sweeping'
require 'rails/queueing'
require 'pp' # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late
@ -35,11 +34,6 @@ module Rails
def env
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
end
def queue
@queue ||= Rails::Queueing::Container.new(Rails::Queueing::SynchronousQueue.new)
end
end
end

View file

@ -10,6 +10,16 @@ require 'controller/fake_controllers'
require 'action_mailer'
ActionMailer::Base.view_paths = FIXTURE_LOAD_PATH
class SynchronousQueue < Queue
def push(job)
job.run
end
alias << push
alias enq push
end
ActionMailer::Base.queue = SynchronousQueue.new
class AssertSelectTest < ActionController::TestCase
Assertion = ActiveSupport::TestCase::Assertion