diff --git a/ChangeLog b/ChangeLog index d8c7b6e8bf..96ea8c3db2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Jun 27 21:19:08 2008 Nobuyoshi Nakada + + * test/inlinetest.rb (InlineTest.in_progname): workaround for frozen + $0. [ruby-dev:35261] + + * lib/test/unit/ui/console/testrunner.rb (TestRunner#finished): ditto. + Fri Jun 27 17:45:17 2008 Kazuhiro NISHIYAMA * lib/erb.rb: adjust line number for magic comment. diff --git a/lib/test/unit/ui/console/testrunner.rb b/lib/test/unit/ui/console/testrunner.rb index 2bd01eefa8..1495300463 100644 --- a/lib/test/unit/ui/console/testrunner.rb +++ b/lib/test/unit/ui/console/testrunner.rb @@ -90,8 +90,11 @@ module Test end def test_started(name) - $0 += "\0#{name}" - $0.sub!(/\0.*\z/, '') + unless defined? $program_name + $program_name = $0 + alias $0 $program_name + end + $PROGRAM_NAME += "\0#{name}" output_single(name + ": ", VERBOSE) end diff --git a/test/inlinetest.rb b/test/inlinetest.rb index 6dbd793f10..46287364a9 100644 --- a/test/inlinetest.rb +++ b/test/inlinetest.rb @@ -33,12 +33,12 @@ module InlineTest end def self.in_progname(progname) - progname_backup = $0.dup - $0.replace(progname) + $program_name = progname + alias $0 $program_name begin yield ensure - $0.replace(progname_backup) + alias $0 $PROGRAM_NAME end end