diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-07 18:54:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-07 18:54:37 +0000 |
commit | 13c76c07e4344d1426e5bbf3898067d939b57af6 (patch) | |
tree | 49bbcb74201c60b2a0bca4b85f6fed9638874143 /lib | |
parent | fbebe84864319be9f31e2600d6a65cd01c20a13f (diff) | |
download | ruby-13c76c07e4344d1426e5bbf3898067d939b57af6.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test/unit.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb index 3a0836c7dd..90b957512e 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 |