From 8f14905e485b5478c6cf4e0d648705cc32bdb060 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Jun 2026 05:01:11 +0000 Subject: [PATCH] Fix Lint/DuplicateMethods in StringIO_test.rb PR #3002 added test_pread, test_read_nonblock and test_sysread that duplicate the existing methods of the same name, breaking rubocop on master. Merge the nil output buffer assertions into the existing methods and drop the duplicate definitions. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01N9NBHdAQGQbyDV7M8MiTLF --- test/stdlib/StringIO_test.rb | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/test/stdlib/StringIO_test.rb b/test/stdlib/StringIO_test.rb index debf0800a..37121ea52 100644 --- a/test/stdlib/StringIO_test.rb +++ b/test/stdlib/StringIO_test.rb @@ -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 @@ -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 @@ -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 @@ -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