summaryrefslogtreecommitdiff
path: root/test/ruby/test_pipe.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_pipe.rb')
-rw-r--r--test/ruby/test_pipe.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_pipe.rb b/test/ruby/test_pipe.rb
index c3b4d29c0a..0ac921b9c2 100644
--- a/test/ruby/test_pipe.rb
+++ b/test/ruby/test_pipe.rb
@@ -15,4 +15,18 @@ class TestPipe < Test::Unit::TestCase
r.close
end
end
+
+ def test_write
+ bug2559 = '[ruby-core:27425]'
+ a, b = IO.pipe
+ begin
+ a.close
+ assert_raises(Errno::EPIPE, bug2559) do
+ b.write("hi")
+ end
+ ensure
+ a.close if !a.closed?
+ b.close if !b.closed?
+ end
+ end
end