aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_rubyoptions.rb5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 409cd2b645..c565c079b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun May 22 09:29:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
+ use spawn. it prevent that other tests inherit renamed $0.
+
Sun May 22 08:57:13 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* ext/openssl/ossl_asn1.c: Default tag lookup in constant time via hash
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 0d2bf747cc..65b6c01031 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -403,9 +403,10 @@ class TestRubyOptions < Test::Unit::TestCase
def test_set_program_name
skip if /linux|freebsd|netbsd|openbsd/ !~ RUBY_PLATFORM
- $0 = 'hello world'
- ps = `ps -p #{$$} -o command`
+ pid = spawn([EnvUtil.rubybin, %!-e "$0 = 'hello world'; sleep 100"!])
+ ps = `ps -p #{pid} -o command`
assert_match(/hello world/, ps)
+ Process.kill :KILL, pid
end
def test_segv_test