summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/suicide.rb2
-rw-r--r--test/ruby/test_beginendblock.rb5
2 files changed, 4 insertions, 3 deletions
diff --git a/test/ruby/suicide.rb b/test/ruby/suicide.rb
new file mode 100644
index 0000000..2687ed0
--- /dev/null
+++ b/test/ruby/suicide.rb
@@ -0,0 +1,2 @@
+STDERR.reopen(STDOUT)
+at_exit{Process.kill(:INT, $$)}
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb
index 4ac8de1..a60e41b 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -69,15 +69,14 @@ 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} #{File.dirname(__FILE__)}/suicide.rb"){|f|
f.read
}
assert_match /Interrupt$/, out