Permalink
Browse files

mocking out debing? call in the MockLogger

  • Loading branch information...
1 parent 38f0161 commit 1b26c66ce470ce68674bbdce738c6f68467cff7d @tenderlove tenderlove committed Jul 19, 2010
@@ -22,6 +22,7 @@ def set_logger(logger)
end
def test_basic_query_logging
+ @logger.debugging = true
Developer.all
wait
assert_equal 1, @logger.logged(:debug).size
@@ -30,6 +31,7 @@ def test_basic_query_logging
end
def test_cached_queries
+ @logger.debugging = true
ActiveRecord::Base.cache do
Developer.all
Developer.all
@@ -48,9 +48,12 @@ def teardown
class MockLogger
attr_reader :flush_count
+ attr_accessor :debugging
+ alias :debug? :debugging
def initialize
@flush_count = 0
+ @debugging = false
@logged = Hash.new { |h,k| h[k] = [] }
end

0 comments on commit 1b26c66

Please sign in to comment.