Skip to content

Commit 2a43392

Browse files
committed
And fix 5
1 parent 8f38ba1 commit 2a43392

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

spec/zip_kit/block_deflate_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def tag_deflated(deflated_string, raw_string)
100100

101101
it "does not write the end marker" do
102102
input_string = "compressible" * (1024 * 1024 * 10)
103-
output_string = ""
103+
output_string = +""
104104

105105
described_class.deflate_in_blocks(StringIO.new(input_string), StringIO.new(output_string))
106106
expect(output_string).not_to be_empty
@@ -109,7 +109,7 @@ def tag_deflated(deflated_string, raw_string)
109109

110110
it "returns the number of bytes written" do
111111
input_string = "compressible" * (1024 * 1024 * 10)
112-
output_string = ""
112+
output_string = +""
113113

114114
num_bytes = described_class.deflate_in_blocks(StringIO.new(input_string),
115115
StringIO.new(output_string))

spec/zip_kit/write_and_tell_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
describe ZipKit::WriteAndTell do
44
it "maintains the count of bytes written" do
5-
adapter = described_class.new("")
5+
adapter = described_class.new(+"")
66
expect(adapter.tell).to be_zero
77

88
adapter << "hello"
@@ -19,16 +19,16 @@
1919
[12, 123, 0, 3].pack("C*")
2020
]
2121

22-
buf = "превед".force_encoding(Encoding::BINARY)
22+
buf = "превед".dup.force_encoding(Encoding::BINARY)
2323
writer = described_class.new(buf)
2424
strs.each { |s| writer << s }
2525
expect(writer.tell).to eq(79)
2626
expect(buf.bytesize).to eq(91) # It already contained some bytes
2727
end
2828

2929
it "does not change the encoding of the source string" do
30-
str = "текста кусок".force_encoding(Encoding::UTF_8)
31-
buf = "превед".force_encoding(Encoding::BINARY)
30+
str = "текста кусок".dup.force_encoding(Encoding::UTF_8)
31+
buf = "превед".dup.force_encoding(Encoding::BINARY)
3232
writer = described_class.new(buf)
3333
writer << str
3434
expect(buf.bytesize).to eq(35)
@@ -60,7 +60,7 @@ def stream_with_just_write.write(bytes)
6060
end
6161

6262
it "advances the internal pointer using advance_position_by" do
63-
str = ""
63+
str = +""
6464

6565
adapter = described_class.new(str)
6666
expect(adapter.tell).to be_zero

0 commit comments

Comments
 (0)