summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-19 07:47:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-19 07:47:17 +0000
commit4f95e22d9c11ed8a29e3a728cc1fc20afc963353 (patch)
treef0f64023bbde2fff8c3c8e1e7fcd459b6a95c05f
parentef7bd1b1676cf9962eec7c3a64a01fab9bb607b0 (diff)
test_io.rb: use assert_separately
* test/ruby/test_io.rb (test_cross_thread_close_stdio): use assert_separately instead of separated fork and assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_io.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 6c62695d6c..9e6b14acee 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2261,25 +2261,18 @@ End
end
def test_cross_thread_close_stdio
- with_pipe do |r,w|
- pid = fork do
+ assert_separately([], <<-'end;')
+ IO.pipe do |r,w|
$stdin.reopen(r)
r.close
read_thread = Thread.new do
- begin
- $stdin.read(1)
- rescue => e
- e
- end
+ $stdin.read(1)
end
sleep(0.1) until read_thread.stop?
$stdin.close
- read_thread.join
- exit(IOError === read_thread.value)
+ assert_raise(IOError) {read_thread.join}
end
- assert Process.waitpid2(pid)[1].success?
- end
- rescue NotImplementedError
+ end;
end
def test_open_mode