Skip to content

Commit

Permalink
Fix tests by using String.new
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewiscowles1986 authored and ioquatix committed Aug 13, 2021
1 parent f3e1486 commit 418fa31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/multipart/post/composite_read_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(*ios)
# Read from IOs in order until `length` bytes have been received.
def read(length = nil, outbuf = nil)
got_result = false
outbuf = outbuf ? outbuf.replace("") : ""
outbuf = outbuf ? outbuf.replace("") : String.new

while io = current_io
if result = io.read(length)
Expand Down
2 changes: 1 addition & 1 deletion spec/multipart/post/composite_read_io_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
end

it "test_read_into_buffer" do
buf = ''
buf = String.new
subject.read(nil, buf)
expect(buf).to be == 'the quick brown fox'
end
Expand Down

0 comments on commit 418fa31

Please sign in to comment.