Skip to content

Commit e9d2f78

Browse files
authored
Merge pull request #486 from azrle/fix/test_upload_large_file
fix: test_upload_large_file should open file in binary file mode
2 parents a4ad4b6 + 67703c5 commit e9d2f78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/backends/test_netssh.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ def test_upload_large_file
180180
size = 25
181181
fills = SecureRandom.random_bytes(1024*1024)
182182
file_name = "/tmp/file-#{size}.txt"
183-
File.open(file_name, 'w') do |f|
183+
File.open(file_name, 'wb') do |f|
184184
(size).times {f.write(fills) }
185185
end
186186
file_contents = ""
187187
Netssh.new(a_host) do
188188
upload!(file_name, file_name)
189189
file_contents = download!(file_name)
190190
end.run
191-
assert_equal File.open(file_name).read, file_contents
191+
assert_equal File.open(file_name, 'rb').read, file_contents
192192
end
193193

194194
def test_upload_via_pathname

0 commit comments

Comments
 (0)