diff options
Diffstat (limited to 'activesupport/test/clean_backtrace_test.rb')
-rw-r--r-- | activesupport/test/clean_backtrace_test.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/activesupport/test/clean_backtrace_test.rb b/activesupport/test/clean_backtrace_test.rb index 86838a7f9a..32e346bb48 100644 --- a/activesupport/test/clean_backtrace_test.rb +++ b/activesupport/test/clean_backtrace_test.rb @@ -5,7 +5,7 @@ class BacktraceCleanerFilterTest < ActiveSupport::TestCase @bc = ActiveSupport::BacktraceCleaner.new @bc.add_filter { |line| line.gsub("/my/prefix", '') } end - + test "backtrace should not contain prefix when it has been filtered out" do assert_equal "/my/class.rb", @bc.clean([ "/my/prefix/my/class.rb" ]).first end @@ -14,14 +14,14 @@ class BacktraceCleanerFilterTest < ActiveSupport::TestCase @bc.remove_filters! assert_equal "/my/prefix/my/class.rb", @bc.clean(["/my/prefix/my/class.rb"]).first end - + test "backtrace should contain unaltered lines if they dont match a filter" do assert_equal "/my/other_prefix/my/class.rb", @bc.clean([ "/my/other_prefix/my/class.rb" ]).first end - + test "backtrace should filter all lines in a backtrace" do assert_equal \ - ["/my/class.rb", "/my/module.rb"], + ["/my/class.rb", "/my/module.rb"], @bc.clean([ "/my/prefix/my/class.rb", "/my/prefix/my/module.rb" ]) end end @@ -31,10 +31,10 @@ class BacktraceCleanerSilencerTest < ActiveSupport::TestCase @bc = ActiveSupport::BacktraceCleaner.new @bc.add_silencer { |line| line =~ /mongrel/ } end - + test "backtrace should not contain lines that match the silencer" do assert_equal \ - [ "/other/class.rb" ], + [ "/other/class.rb" ], @bc.clean([ "/mongrel/class.rb", "/other/class.rb", "/mongrel/stuff.rb" ]) end end @@ -45,7 +45,7 @@ class BacktraceCleanerFilterAndSilencerTest < ActiveSupport::TestCase @bc.add_filter { |line| line.gsub("/mongrel", "") } @bc.add_silencer { |line| line =~ /mongrel/ } end - + test "backtrace should not silence lines that has first had their silence hook filtered out" do assert_equal [ "/class.rb" ], @bc.clean([ "/mongrel/class.rb" ]) end |