Skip to content

Commit 344768a

Browse files
committed
Fix tests on Windows
On Windows, binary files must opened in 'binary' mode.
1 parent 8b5afd4 commit 344768a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/models/zip/bzip2/decompress_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ def file_text
4747
end
4848

4949
def compressed_data
50-
@compressed_data ||= File.open(BZIP2_FILE, &:read)
50+
@compressed_data ||= File.open(BZIP2_FILE, 'rb', &:read)
5151
end
5252
end

test/models/zip/bzip2/libbz2_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ def file_text
7878
end
7979

8080
def compressed_data
81-
@compressed_data ||= File.open(BZIP2_FILE, &:read)
81+
@compressed_data ||= File.open(BZIP2_FILE, 'rb', &:read)
8282
end
8383
end

0 commit comments

Comments
 (0)