diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-07-18 00:52:20 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-07-18 00:52:20 -0700 |
commit | c08f30ff5fcda7e07cd9275a073acb2091e4b3f7 (patch) | |
tree | 52db081cfd3cdf44d3cdcfccfc328232ad434f19 /activesupport/test | |
parent | e243a8a32eb4c8777f07ca4b974bd7e38d9477d3 (diff) | |
parent | dc97a9a9ddc98ff65cc4826ac96c8594fec7b8f0 (diff) | |
download | rails-c08f30ff5fcda7e07cd9275a073acb2091e4b3f7.tar.gz rails-c08f30ff5fcda7e07cd9275a073acb2091e4b3f7.tar.bz2 rails-c08f30ff5fcda7e07cd9275a073acb2091e4b3f7.zip |
Merge pull request #7084 from LTe/logger_default_separator
Don't use default separator in tagged logger
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/tagged_logging_test.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/activesupport/test/tagged_logging_test.rb b/activesupport/test/tagged_logging_test.rb index 0751c2469e..732a28c56f 100644 --- a/activesupport/test/tagged_logging_test.rb +++ b/activesupport/test/tagged_logging_test.rb @@ -10,8 +10,13 @@ class TaggedLoggingTest < ActiveSupport::TestCase end setup do - @output = StringIO.new - @logger = ActiveSupport::TaggedLogging.new(MyLogger.new(@output)) + @output = StringIO.new + @logger = ActiveSupport::TaggedLogging.new(MyLogger.new(@output)) + @separator = $, + end + + after do + $, = @separator end test "tagged once" do @@ -69,4 +74,10 @@ class TaggedLoggingTest < ActiveSupport::TestCase assert_equal "[BCX] [Jason] Funky time\n[BCX] Junky time!\n", @output.string end + + test "using the correct separator" do + $, = "_" + @logger.tagged("BCX", "BDX") { @logger.info "Funky time" } + assert_equal "[BCX] [BDX] Funky time\n", @output.string + end end |