summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 18:44:49 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 18:44:49 +0000
commit15689ed7780b06ddc14cde4f427de834177283a5 (patch)
treebed64f4fdaf3e1a140642bdd0354384ae286759c /test/ruby/test_io.rb
parent967eab83e333430600926366621aa3a978701c6a (diff)
Fix test-all tests to avoid creating report_on_exception warnings
* The warnings are shown by Thread.report_on_exception defaulting to true. [Feature #14143] [ruby-core:83979] * Improves tests by narrowing down the scope where an exception is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index f3b509a261..009afc3297 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -3392,12 +3392,16 @@ __END__
str = ""
IO.pipe {|r,|
- t = Thread.new { r.read(nil, str) }
+ t = Thread.new {
+ assert_raise(RuntimeError) {
+ r.read(nil, str)
+ }
+ }
sleep 0.1 until t.stop?
t.raise
sleep 0.1 while t.alive?
assert_nothing_raised(RuntimeError, bug8669) { str.clear }
- assert_raise(RuntimeError) { t.join }
+ t.join
}
end if /cygwin/ !~ RUBY_PLATFORM
@@ -3406,12 +3410,16 @@ __END__
str = ""
IO.pipe {|r, w|
- t = Thread.new { r.readpartial(4096, str) }
+ t = Thread.new {
+ assert_raise(RuntimeError) {
+ r.readpartial(4096, str)
+ }
+ }
sleep 0.1 until t.stop?
t.raise
sleep 0.1 while t.alive?
assert_nothing_raised(RuntimeError, bug8669) { str.clear }
- assert_raise(RuntimeError) { t.join }
+ t.join
}
end if /cygwin/ !~ RUBY_PLATFORM
@@ -3431,12 +3439,16 @@ __END__
str = ""
IO.pipe {|r, w|
- t = Thread.new { r.sysread(4096, str) }
+ t = Thread.new {
+ assert_raise(RuntimeError) {
+ r.sysread(4096, str)
+ }
+ }
sleep 0.1 until t.stop?
t.raise
sleep 0.1 while t.alive?
assert_nothing_raised(RuntimeError, bug8669) { str.clear }
- assert_raise(RuntimeError) { t.join }
+ t.join
}
end if /cygwin/ !~ RUBY_PLATFORM