summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-22 00:31:19 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-22 00:31:19 +0000
commit20f635d6b23332a5f3f4f6b0ffa1e2cf6d6b4089 (patch)
treeddda3b2b09c8a8e19a30b3ba0999cd19898ffb61
parentdb874053457803ef694145c36249ad42aae5a49f (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
-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 409cd2b6450..c565c079b76 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 0d2bf747cc2..65b6c01031e 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