summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-02 13:45:20 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-02 13:45:20 +0000
commit51f41f66181932aa0a42be2a430a04813c0d6abf (patch)
tree0d4b49aa9bd7f05c78199d4c5a9f7831f925d384 /test
parent6bd80ffc2277eca027075c4f209feb92cf5c501e (diff)
* test/ruby/test_io.rb (test_new_with_block): Set autoclose to avoid EBADF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 95331ba02d..3bba329344 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2282,11 +2282,15 @@ End
end
def test_new_with_block
- assert_in_out_err([], "r, w = IO.pipe; IO.new(r.fileno) {}", [], /^.+$/)
+ assert_in_out_err([], "r, w = IO.pipe; r.autoclose=false; IO.new(r.fileno) {}.close", [], /^.+$/)
n = "IO\u{5165 51fa 529b}"
c = eval("class #{n} < IO; self; end")
IO.pipe do |r, w|
- assert_warning(/#{n}/) {c.new(r.fileno) {}}
+ assert_warning(/#{n}/) {
+ r.autoclose=false
+ io = c.new(r.fileno) {}
+ io.close
+ }
end
end