test: read mock-archives in binary mode

this doesn't hurt in *nix, but makes tests pass on windows.
This commit is contained in:
Stephan Renatus 2016-02-22 13:47:33 +01:00
parent c891686d72
commit 2da97df5f0

View file

@ -82,7 +82,7 @@ describe Fetchers::Url do
let(:res) {
mock_open = Minitest::Mock.new
mock_open.expect :meta, {'content-type' => 'application/gzip'}
mock_open.expect :read, File.read(mock_file)
mock_open.expect :read, File.open(mock_file, 'rb').read
fetcher.expects(:open).returns(mock_open)
fetcher.resolve(target)
}
@ -115,7 +115,7 @@ describe Fetchers::Url do
let(:res) {
mock_open = Minitest::Mock.new
mock_open.expect :meta, {'content-type' => 'application/zip'}
mock_open.expect :read, File.read(mock_file)
mock_open.expect :read, File.open(mock_file, 'rb').read
fetcher.expects(:open).returns(mock_open)
fetcher.resolve(target)
}