summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-08 04:35:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-08 04:35:13 +0000
commitb4b9183ffc44b03a12d7a4c3abfdc8bf9d197454 (patch)
treef92388d0ad6b72c06be65af9ef5f062c4347e8d1
parent844ddfdd0da7f06edfda1fa960fd1609d1264565 (diff)
lib/test/unit.rb: remove exact trace
* lib/test/unit.rb (MiniTest#run_test): remove exact trace and get rid of IndexError, which could caused by modified $@ sometimes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/test/unit.rb3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b32bfddbfc..560b3f9e234 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 8 13:35:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (MiniTest#run_test): remove exact trace and get rid
+ of IndexError, which could caused by modified $@ sometimes.
+
Tue May 8 11:21:27 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* test/minitest/metametameta.rb (MetaMetaMetaTestCase#assert_report):
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index 85e6885fab8..ed465e97a65 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -792,11 +792,12 @@ end
class MiniTest::Unit::TestCase
undef run_test
+ RUN_TEST_TRACE = "#{__FILE__}:#{__LINE__+3}:in `run_test'".freeze
def run_test(name)
progname, $0 = $0, "#{$0}: #{self.class}##{name}"
self.__send__(name)
ensure
- $@[-caller.size, 1] = [] if $@
+ $@.delete(RUN_TEST_TRACE) if $@
$0 = progname
end
end