summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_rubyoptions.rb5
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