summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 18:54:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 18:54:37 +0000
commit13c76c07e4344d1426e5bbf3898067d939b57af6 (patch)
tree49bbcb74201c60b2a0bca4b85f6fed9638874143
parentfbebe84864319be9f31e2600d6a65cd01c20a13f (diff)
lib/test/unit.rb: test name in $0
* lib/test/unit.rb (MiniTest#run_test): show the running test in $0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/test/unit.rb11
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8bf7aef4574..e828198b415 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-Tue May 8 03:54:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue May 8 03:54:34 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit.rb (MiniTest#run_test): show the running test in $0.
* lib/test/unit.rb (Test::Unit::StatusLineOutput): new class to output
in status line.
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index 3a0836c7ddc..90b957512e5 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -786,4 +786,15 @@ module Test
end
end
+class MiniTest::Unit::TestCase
+ undef run_test
+ def run_test(name)
+ progname, $0 = $0, "#{$0}: #{self.class}##{name}"
+ self.__send__(name)
+ ensure
+ $@[-caller.size, 1] = [] if $@
+ $0 = progname
+ end
+end
+
Test::Unit::Runner.autorun