Fix Performance/FixedSize cop.
This commit is contained in:
parent
ed21f9cf17
commit
7af12ca887
|
@ -51,11 +51,6 @@ Naming/AccessorMethodName:
|
|||
- 'lib/zip/input_stream.rb'
|
||||
- 'lib/zip/streamable_stream.rb'
|
||||
|
||||
# Offense count: 2
|
||||
Performance/FixedSize:
|
||||
Exclude:
|
||||
- 'test/ioextras/abstract_output_stream_test.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
Performance/RegexpMatch:
|
||||
|
|
|
@ -32,13 +32,15 @@ class AbstractOutputStreamTest < MiniTest::Test
|
|||
end
|
||||
|
||||
def test_write
|
||||
count = @output_stream.write('a little string')
|
||||
assert_equal('a little string', @output_stream.buffer)
|
||||
assert_equal('a little string'.length, count)
|
||||
str1 = 'a little string'
|
||||
count = @output_stream.write(str1)
|
||||
assert_equal(str1, @output_stream.buffer)
|
||||
assert_equal(str1.length, count)
|
||||
|
||||
count = @output_stream.write('. a little more')
|
||||
assert_equal('a little string. a little more', @output_stream.buffer)
|
||||
assert_equal('. a little more'.length, count)
|
||||
str2 = '. a little more'
|
||||
count = @output_stream.write(str2)
|
||||
assert_equal(str1 + str2, @output_stream.buffer)
|
||||
assert_equal(str2.length, count)
|
||||
end
|
||||
|
||||
def test_print
|
||||
|
|
Loading…
Reference in New Issue