Fix tests of benchmark with silence equals to true

This commit is contained in:
Rafael Mendonça França
2012-04-04 16:14:13 -03:00
parent 6663dd0969
commit 1124ac00c9

View File

@@ -1992,9 +1992,7 @@ class BasicsTest < ActiveRecord::TestCase
original_logger = ActiveRecord::Base.logger
log = StringIO.new
ActiveRecord::Base.logger = Logger.new(log)
assert_deprecated do
ActiveRecord::Base.benchmark("Logging", :level => :debug, :silence => true) { ActiveRecord::Base.logger.debug "Loud" }
end
ActiveRecord::Base.benchmark("Logging", :level => :debug, :silence => true) { ActiveRecord::Base.logger.debug "Loud" }
ActiveRecord::Base.benchmark("Logging", :level => :debug, :silence => false) { ActiveRecord::Base.logger.debug "Quiet" }
assert_no_match(/Loud/, log.string)
assert_match(/Quiet/, log.string)