summaryrefslogtreecommitdiff
path: root/test/ruby/test_beginendblock.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-10 04:46:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-10 04:46:17 +0000
commit7d8743d5c50bb95d6f3296d125f921445eb07513 (patch)
treef1abe42c83a8f723ec62b13b13f8e3732077f43f /test/ruby/test_beginendblock.rb
parentd4d7164a9bda880ea998a382b20f9f7e4218d2c8 (diff)
* test/ruby/test_beginendblock.rb (test_should_propagate_signaled):
get rid of invoking shell. [ruby-dev:30942] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_beginendblock.rb')
-rw-r--r--test/ruby/test_beginendblock.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb
index 3b087593cd..ec3fcf8c87 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -13,7 +13,7 @@ class TestBeginEndBlock < Test::Unit::TestCase
def test_beginendblock
ruby = EnvUtil.rubybin
target = File.join(DIR, 'beginmainend.rb')
- result = IO.popen("#{q(ruby)} #{q(target)}"){|io|io.read}
+ result = IO.popen([ruby, target]){|io|io.read}
assert_equal(%w(b1 b2-1 b2 main b3-1 b3 b4 e1 e4 e3 e2 e4-2 e4-1 e1-1 e4-1-1), result.split)
end
@@ -38,14 +38,13 @@ errout = ARGV.shift
STDERR.reopen(File.open(errout, "w"))
STDERR.sync = true
Dir.chdir(#{q(DIR)})
-cmd = "\\"#{ruby}\\" \\"endblockwarn.rb\\""
-system(cmd)
+system("#{ruby}", "endblockwarn.rb")
EOF
launcher.close
launcherpath = launcher.path
errout.close
erroutpath = errout.path
- system("#{q(ruby)} #{q(launcherpath)} #{q(erroutpath)}")
+ system(ruby, launcherpath, erroutpath)
expected = <<EOW
endblockwarn.rb:2: warning: END in method; use at_exit
(eval):2: warning: END in method; use at_exit
@@ -57,9 +56,9 @@ EOW
def test_raise_in_at_exit
# [ruby-core:09675]
ruby = EnvUtil.rubybin
- out = IO.popen("#{q(ruby)} -e 'STDERR.reopen(STDOUT);" \
- "at_exit{raise %[SomethingBad]};" \
- "raise %[SomethingElse]'") {|f|
+ out = IO.popen([ruby, '-e', 'STDERR.reopen(STDOUT)',
+ '-e', 'at_exit{raise %[SomethingBad]}'
+ '-e', 'raise %[SomethingElse]') {|f|
f.read
}
assert_match /SomethingBad/, out
@@ -68,15 +67,15 @@ EOW
def test_should_propagate_exit_code
ruby = EnvUtil.rubybin
- assert_equal false, system("#{q(ruby)} -e 'at_exit{exit 2}'")
+ assert_equal false, system(ruby, '-e', 'at_exit{exit 2}')
assert_equal 2, $?.exitstatus
assert_nil $?.termsig
end
def test_should_propagate_signaled
ruby = EnvUtil.rubybin
- out = IO.popen("#{q(ruby)} -e 'STDERR.reopen(STDOUT);" \
- "at_exit{Process.kill(:INT, $$)}'"){|f|
+ out = IO.popen([ruby, '-e', 'STDERR.reopen(STDOUT)',
+ '-e', 'at_exit{Process.kill(:INT, $$)}']) {|f|
f.read
}
assert_match /Interrupt$/, out