1 require File.dirname(__FILE__) + '/helper'
3 class TestLogger < Test::Unit::TestCase
11 @log.expects(:info).with("qux")
14 @log.log(stub(:name => 'foo'), :info, "qux")
17 assert_equal 1, @log.logs.size
18 assert_instance_of Time, @log.logs['foo'][0][0]
19 assert_match(/qux/, @log.logs['foo'][0][1])
24 def test_watch_log_since
28 @log.log(stub(:name => 'foo'), :info, "one")
29 @log.log(stub(:name => 'foo'), :info, "two")
32 assert_match(/one.*two/m, @log.watch_log_since('foo', t1))
37 @log.log(stub(:name => 'foo'), :info, "three")
40 out = @log.watch_log_since('foo', t2)
42 assert_no_match(/one/, out)
43 assert_no_match(/two/, out)
44 assert_match(/three/, out)
53 assert_equal 0, @log.logs.size