Skip to content

Commit 954dc17

Browse files
authored
Merge pull request #3010 from ruby/claude/modest-lovelace-6tmymu
Fix Lint/DuplicateMethods in StringIO_test.rb
2 parents 6e67f21 + 8f14905 commit 954dc17

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

test/stdlib/StringIO_test.rb

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,11 @@ def test_read
7575
StringIO.new("a"), :read, 1, nil
7676
end
7777

78-
def test_pread
79-
assert_send_type "(::Integer, ::Integer, nil) -> ::String",
80-
StringIO.new("a"), :pread, 1, 0, nil
81-
end
82-
83-
def test_read_nonblock
84-
assert_send_type "(::int, nil) -> ::String?",
85-
StringIO.new("a"), :read_nonblock, 1, nil
86-
end
87-
8878
def test_readpartial
8979
assert_send_type "(::int, nil) -> ::String",
9080
StringIO.new("a"), :readpartial, 1, nil
9181
end
9282

93-
def test_sysread
94-
assert_send_type "(::Integer, nil) -> ::String",
95-
StringIO.new("a"), :sysread, 1, nil
96-
end
97-
9883
def test_truncate
9984
io = StringIO.new
10085

@@ -135,6 +120,8 @@ def test_pread
135120
StringIO.new("abcdef"), :pread, 3, 0
136121
assert_send_type "(Integer, Integer, String) -> String",
137122
StringIO.new("abcdef"), :pread, 3, 0, +"buf"
123+
assert_send_type "(::Integer, ::Integer, nil) -> ::String",
124+
StringIO.new("a"), :pread, 1, 0, nil
138125
end
139126

140127
def test_read_nonblock
@@ -148,6 +135,8 @@ def test_read_nonblock
148135
StringIO.new("abc"), :read_nonblock, 2, exception: false
149136
assert_send_type "(int, exception: false) -> nil",
150137
StringIO.new(""), :read_nonblock, 2, exception: false
138+
assert_send_type "(::int, nil) -> ::String?",
139+
StringIO.new("a"), :read_nonblock, 1, nil
151140
end
152141

153142
def test_write_nonblock
@@ -164,6 +153,8 @@ def test_sysread
164153
StringIO.new("abc"), :sysread, 2
165154
assert_send_type "(Integer, String) -> String",
166155
StringIO.new("abc"), :sysread, 2, +"buf"
156+
assert_send_type "(::Integer, nil) -> ::String",
157+
StringIO.new("a"), :sysread, 1, nil
167158
end
168159

169160
def test_ungetc

0 commit comments

Comments
 (0)