diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-22 00:31:19 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-22 00:31:19 +0000 |
commit | 20f635d6b23332a5f3f4f6b0ffa1e2cf6d6b4089 (patch) | |
tree | ddda3b2b09c8a8e19a30b3ba0999cd19898ffb61 /test/ruby/test_rubyoptions.rb | |
parent | db874053457803ef694145c36249ad42aae5a49f (diff) |
* 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
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |