Skip to content

Commit

Permalink
Fix tests on Windows if git core.autocrlf=true
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Botalov committed Jan 17, 2017
1 parent a7565fc commit 01a38cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/http/form_data/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def with_io
if @file_or_io.is_a?(::File) || @file_or_io.is_a?(StringIO)
yield @file_or_io
else
::File.open(@file_or_io) { |io| yield io }
::File.open(@file_or_io, "rb") { |io| yield io }
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/http/form_data/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

context "when file given as a String" do
let(:file) { fixture("the-http-gem.info").to_s }
it { is_expected.to eq fixture("the-http-gem.info").read }
it { is_expected.to eq fixture("the-http-gem.info").read(:mode => "rb") }
end

context "when file given as StringIO" do
Expand All @@ -37,9 +37,9 @@
end

context "when file given as File" do
let(:file) { fixture("the-http-gem.info").open }
let(:file) { fixture("the-http-gem.info").open("rb") }
after { file.close }
it { is_expected.to eq fixture("the-http-gem.info").read }
it { is_expected.to eq fixture("the-http-gem.info").read(:mode => "rb") }
end
end

Expand Down

0 comments on commit 01a38cc

Please sign in to comment.