diff options
Diffstat (limited to 'activesupport/test/tagged_logging_test.rb')
-rw-r--r-- | activesupport/test/tagged_logging_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/activesupport/test/tagged_logging_test.rb b/activesupport/test/tagged_logging_test.rb index 7253eb1222..91c311ba16 100644 --- a/activesupport/test/tagged_logging_test.rb +++ b/activesupport/test/tagged_logging_test.rb @@ -4,14 +4,24 @@ require 'active_support/tagged_logging' class TaggedLoggingTest < ActiveSupport::TestCase class MyLogger < ::Logger + attr_accessor :last_message + attr_accessor :last_progname + def flush(*) info "[FLUSHED]" end + + def add(severity, message = nil, progname = nil, &block) + @last_message = message + @last_progname = progname + super(severity, message, progname, &block) + end end setup do @output = StringIO.new - @logger = ActiveSupport::TaggedLogging.new(MyLogger.new(@output)) + @my_logger = MyLogger.new(@output) + @logger = ActiveSupport::TaggedLogging.new(@my_logger) end test "tagged once" do |