Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions test/stdlib/IO_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,20 +528,22 @@ class IOWaitTest < Test::Unit::TestCase
def test_readyp
# This method returns true|false in Ruby 2.7, nil|IO in 3.0, and true|false in 3.1.

IO.pipe.tap do |r, w|
assert_send_type(
"() -> untyped",
r, :ready?
)
end
if_ruby(..."4.0.0", skip: false) do
IO.pipe.tap do |r, w|
assert_send_type(
"() -> untyped",
r, :ready?
)
end

IO.pipe.tap do |r, w|
w.write("hello")
IO.pipe.tap do |r, w|
w.write("hello")

assert_send_type(
"() -> untyped",
r, :ready?
)
assert_send_type(
"() -> untyped",
r, :ready?
)
end
end
end

Expand Down Expand Up @@ -584,11 +586,13 @@ def test_wait_writable
end

def test_nread
IO.pipe.tap do |r, w|
assert_send_type(
"() -> Integer",
r, :nread
)
if_ruby(..."4.0.0", skip: false) do
IO.pipe.tap do |r, w|
assert_send_type(
"() -> Integer",
r, :nread
)
end
end
end

Expand Down