Skip to content

Commit

Permalink
Merge pull request #1753 from ruby/backport-1752
Browse files Browse the repository at this point in the history
Backport #1752
  • Loading branch information
soutaro committed Feb 8, 2024
2 parents fe63895 + f6f7077 commit 7b65f5c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/stdlib/IO_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,16 @@ def test_binwrite

def test_open
Dir.mktmpdir do |dir|
fd = IO.sysopen(File.expand_path(__FILE__))

assert_send_type "(Integer) -> IO",
IO, :open, fd
IO, :open, IO.sysopen(File.expand_path(__FILE__))
assert_send_type "(ToInt, String) -> IO",
IO, :open, ToInt.new(fd), "r"
IO, :open, ToInt.new(IO.sysopen(File.expand_path(__FILE__))), "r"
assert_send_type "(Integer) { (IO) -> Integer } -> Integer",
IO, :open, fd do |io| io.read.size end
IO, :open, IO.sysopen(File.expand_path(__FILE__)), &proc {|io| io.read.size }

fd = IO.sysopen(File.expand_path(__FILE__))
assert_send_type(
"(ToInt, path: String) -> IO",
IO, :open, ToInt.new(fd), path: "<<TEST>>"
IO, :open, ToInt.new(IO.sysopen(File.expand_path(__FILE__))), path: "<<TEST>>"
)
end
end
Expand Down

0 comments on commit 7b65f5c

Please sign in to comment.