diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2016-02-20 18:41:33 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2016-02-20 18:41:33 +0100 |
commit | e76891314126b10d5cf57aaf776dfa2a26553ec3 (patch) | |
tree | ddbf63ad02f922f1ce97987f77b8a787ed694477 /activesupport/test | |
parent | eb65f04fb2d53c8bd89e48d0fce731eb1ac1a196 (diff) | |
download | rails-e76891314126b10d5cf57aaf776dfa2a26553ec3.tar.gz rails-e76891314126b10d5cf57aaf776dfa2a26553ec3.tar.bz2 rails-e76891314126b10d5cf57aaf776dfa2a26553ec3.zip |
Make benchmark('something', silence: true) actually work
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/benchmarkable_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/benchmarkable_test.rb b/activesupport/test/benchmarkable_test.rb index 04d4f5e503..5af041f458 100644 --- a/activesupport/test/benchmarkable_test.rb +++ b/activesupport/test/benchmarkable_test.rb @@ -41,6 +41,20 @@ class BenchmarkableTest < ActiveSupport::TestCase assert_last_logged 'test_run' end + def test_with_silence + assert_difference 'buffer.count', +2 do + benchmark('test_run') do + logger.info "SOMETHING" + end + end + + assert_difference 'buffer.count', +1 do + benchmark('test_run', silence: true) do + logger.info "NOTHING" + end + end + end + def test_within_level logger.level = ActiveSupport::Logger::DEBUG benchmark('included_debug_run', :level => :debug) { } |