aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2022-10-15 01:45:51 +1300
committerGitHub <noreply@github.com>2022-10-15 01:45:51 +1300
commitd4162053410782a449e0921ee7222e7ce3deca6f (patch)
tree4e678661f05846195bdc38be5c321ffee1567ebf /test/ruby/test_io.rb
parent7b7e5153e81288fe57ae64f2e1db228435156aeb (diff)
downloadruby-d4162053410782a449e0921ee7222e7ce3deca6f.tar.gz
Copy `IO#timeout` on `IO#dup`. (#6546)
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 0c8beb2f95..989c4c8991 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1441,6 +1441,14 @@ class TestIO < Test::Unit::TestCase
End
end
+ def test_dup_timeout
+ with_pipe do |r, w|
+ r.timeout = 0.1
+ r2 = r.dup
+ assert_equal(0.1, r2.timeout)
+ end
+ end
+
def test_inspect
with_pipe do |r, w|
assert_match(/^#<IO:fd \d+>$/, r.inspect)