Skip to content
Merged
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
21 changes: 6 additions & 15 deletions test/stdlib/StringIO_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,11 @@ def test_read
StringIO.new("a"), :read, 1, nil
end

def test_pread
assert_send_type "(::Integer, ::Integer, nil) -> ::String",
StringIO.new("a"), :pread, 1, 0, nil
end

def test_read_nonblock
assert_send_type "(::int, nil) -> ::String?",
StringIO.new("a"), :read_nonblock, 1, nil
end

def test_readpartial
assert_send_type "(::int, nil) -> ::String",
StringIO.new("a"), :readpartial, 1, nil
end

def test_sysread
assert_send_type "(::Integer, nil) -> ::String",
StringIO.new("a"), :sysread, 1, nil
end

def test_truncate
io = StringIO.new

Expand Down Expand Up @@ -135,6 +120,8 @@ def test_pread
StringIO.new("abcdef"), :pread, 3, 0
assert_send_type "(Integer, Integer, String) -> String",
StringIO.new("abcdef"), :pread, 3, 0, +"buf"
assert_send_type "(::Integer, ::Integer, nil) -> ::String",
StringIO.new("a"), :pread, 1, 0, nil
end

def test_read_nonblock
Expand All @@ -148,6 +135,8 @@ def test_read_nonblock
StringIO.new("abc"), :read_nonblock, 2, exception: false
assert_send_type "(int, exception: false) -> nil",
StringIO.new(""), :read_nonblock, 2, exception: false
assert_send_type "(::int, nil) -> ::String?",
StringIO.new("a"), :read_nonblock, 1, nil
end

def test_write_nonblock
Expand All @@ -164,6 +153,8 @@ def test_sysread
StringIO.new("abc"), :sysread, 2
assert_send_type "(Integer, String) -> String",
StringIO.new("abc"), :sysread, 2, +"buf"
assert_send_type "(::Integer, nil) -> ::String",
StringIO.new("a"), :sysread, 1, nil
end

def test_ungetc
Expand Down
Loading