diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-24 12:13:09 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-24 12:13:09 -0500 |
commit | 9f96708f53b4eee8830554dd8f0a482160ef4c73 (patch) | |
tree | c2899c3716b0ae6715cd617d1d6b443f84da205b /actionpack/test/controller | |
parent | c2f8b4e92f8487b83a7c7bd0f19e535a9122d20e (diff) | |
download | rails-9f96708f53b4eee8830554dd8f0a482160ef4c73.tar.gz rails-9f96708f53b4eee8830554dd8f0a482160ef4c73.tar.bz2 rails-9f96708f53b4eee8830554dd8f0a482160ef4c73.zip |
Resurrect AC::Benchmarking [#3140 state:resolved]
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/logging_test.rb | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/actionpack/test/controller/logging_test.rb b/actionpack/test/controller/logging_test.rb index 98ffbc3813..2b5e8d8bde 100644 --- a/actionpack/test/controller/logging_test.rb +++ b/actionpack/test/controller/logging_test.rb @@ -12,11 +12,11 @@ class LoggingTest < ActionController::TestCase class MockLogger attr_reader :logged attr_accessor :level - + def initialize @level = Logger::DEBUG end - + def method_missing(method, *args, &blk) @logged ||= [] @logged << args.first @@ -31,25 +31,24 @@ class LoggingTest < ActionController::TestCase def test_logging_without_parameters get :show - assert_equal 2, logs.size + assert_equal 3, logs.size assert_nil logs.detect {|l| l =~ /Parameters/ } end def test_logging_with_parameters get :show, :id => '10' - assert_equal 3, logs.size + assert_equal 4, logs.size params = logs.detect {|l| l =~ /Parameters/ } assert_equal 'Parameters: {"id"=>"10"}', params end - + private + def set_logger + @controller.logger = MockLogger.new + end - def set_logger - @controller.logger = MockLogger.new - end - - def logs - @logs ||= @controller.logger.logged.compact.map {|l| l.to_s.strip} - end + def logs + @logs ||= @controller.logger.logged.compact.map {|l| l.to_s.strip} + end end |