diff options
author | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-27 14:36:59 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-12-27 14:36:59 -0800 |
commit | 12e43494a748e0144195be12dc19161cc3e4d39f (patch) | |
tree | c06f88b7ddf6e41205838cc6f4edd2257a801dcb /actionpack/test/abstract_unit.rb | |
parent | 1c26ba486c23f229a12fea6ccad33e6cb3122b91 (diff) | |
parent | 97db79ab3c0af7b6805dcaee99384d96ccb3567d (diff) | |
download | rails-12e43494a748e0144195be12dc19161cc3e4d39f.tar.gz rails-12e43494a748e0144195be12dc19161cc3e4d39f.tar.bz2 rails-12e43494a748e0144195be12dc19161cc3e4d39f.zip |
Merge remote branch 'jose/perf'
Diffstat (limited to 'actionpack/test/abstract_unit.rb')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index a9341b60df..8c65087898 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -50,6 +50,14 @@ ORIGINAL_LOCALES = I18n.available_locales.map {|locale| locale.to_s }.sort FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures') FIXTURES = Pathname.new(FIXTURE_LOAD_PATH) +# Turn on notifications +require 'active_support/notifications' +Thread.abort_on_exception = true + +ActiveSupport::Notifications.subscribe do |*args| + ActionController::Base.log_event(*args) if ActionController::Base.logger +end + module SetupOnce extend ActiveSupport::Concern @@ -87,6 +95,21 @@ class ActiveSupport::TestCase end end +class MockLogger + attr_reader :logged + attr_accessor :level + + def initialize + @level = Logger::DEBUG + @logged = [] + end + + def method_missing(method, *args, &blk) + @logged << args.first + @logged << blk.call if block_given? + end +end + class ActionController::IntegrationTest < ActiveSupport::TestCase def self.build_app(routes = nil) ActionDispatch::MiddlewareStack.new { |middleware| |