From 20f635d6b23332a5f3f4f6b0ffa1e2cf6d6b4089 Mon Sep 17 00:00:00 2001 From: kosaki Date: Sun, 22 May 2011 00:31:19 +0000 Subject: * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name): use spawn. it prevent that other tests inherit renamed $0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/ruby/test_rubyoptions.rb | 5 +++-- 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 + + * 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 * 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 -- cgit v1.2.3