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/input_stream.rb'
|
||||||
- 'lib/zip/streamable_stream.rb'
|
- 'lib/zip/streamable_stream.rb'
|
||||||
|
|
||||||
# Offense count: 2
|
|
||||||
Performance/FixedSize:
|
|
||||||
Exclude:
|
|
||||||
- 'test/ioextras/abstract_output_stream_test.rb'
|
|
||||||
|
|
||||||
# Offense count: 2
|
# Offense count: 2
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
Performance/RegexpMatch:
|
Performance/RegexpMatch:
|
||||||
|
|
|
@ -32,13 +32,15 @@ class AbstractOutputStreamTest < MiniTest::Test
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_write
|
def test_write
|
||||||
count = @output_stream.write('a little string')
|
str1 = 'a little string'
|
||||||
assert_equal('a little string', @output_stream.buffer)
|
count = @output_stream.write(str1)
|
||||||
assert_equal('a little string'.length, count)
|
assert_equal(str1, @output_stream.buffer)
|
||||||
|
assert_equal(str1.length, count)
|
||||||
|
|
||||||
count = @output_stream.write('. a little more')
|
str2 = '. a little more'
|
||||||
assert_equal('a little string. a little more', @output_stream.buffer)
|
count = @output_stream.write(str2)
|
||||||
assert_equal('. a little more'.length, count)
|
assert_equal(str1 + str2, @output_stream.buffer)
|
||||||
|
assert_equal(str2.length, count)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_print
|
def test_print
|
||||||
|
|
Loading…
Reference in New Issue