Skip to content

Commit

Permalink
Merge pull request #828 from mame/io-readyp-was-changed
Browse files Browse the repository at this point in the history
Use "untyped" as an exceptation of return value of IO#ready?
  • Loading branch information
mame committed Nov 17, 2021
2 parents 6abf29d + 7fe2b45 commit 39a2351
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/stdlib/IO_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,11 @@ class IOWaitTest < Test::Unit::TestCase

def test_readyp
if_ruby3 do
# 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(
"() -> nil",
"() -> untyped",
r, :ready?
)
end
Expand All @@ -263,7 +265,7 @@ def test_readyp
w.write("hello")

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

0 comments on commit 39a2351

Please sign in to comment.