From 9ad152e55580b497cbba4c7a15d20cba8e3ef1f5 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 1 May 2010 13:41:10 +0000 Subject: [PATCH] * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): keep the first trace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++++- lib/test/unit/assertions.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4d8f30ad4..8b833b6f86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -Sat May 1 22:27:45 2010 Nobuyoshi Nakada +Sat May 1 22:41:05 2010 Nobuyoshi Nakada + + * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): + keep the first trace. * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): fixed filtering. [ruby-core:29908] diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb index a06962fceb..f4e4e74e1e 100644 --- a/lib/test/unit/assertions.rb +++ b/lib/test/unit/assertions.rb @@ -12,7 +12,7 @@ module Test def assert(test, msg = (nomsg = true; nil)) unless nomsg or msg.instance_of?(String) or msg.instance_of?(Proc) or - (bt = caller).shift.rindex(MiniTest::MINI_DIR, 0) + (bt = caller).first.rindex(MiniTest::MINI_DIR, 0) bt.delete_if {|s| s.rindex(MiniTest::MINI_DIR, 0)} raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt end