Skip to content
Browse files

Ensure binary modes are used in tests, for Windows

  • Loading branch information...
1 parent 60c66b5 commit 5497fd2dfc560ac2c4e33e263e6c29c2ec6b4816 @raggi raggi committed
Showing with 2 additions and 2 deletions.
  1. +1 −1 test/spec_multipart.rb
  2. +1 −1 test/spec_sendfile.rb
View
2 test/spec_multipart.rb
@@ -364,7 +364,7 @@ def rd.length
end
it "builds complete params with the chunk size of 16384 slicing exactly on boundary" do
- data = File.open(multipart_file("fail_16384_nofile")) { |f| f.read }.gsub(/\n/, "\r\n")
+ data = File.open(multipart_file("fail_16384_nofile"), 'rb') { |f| f.read }.gsub(/\n/, "\r\n")
options = {
"CONTENT_TYPE" => "multipart/form-data; boundary=----WebKitFormBoundaryWsY0GnpbI5U7ztzo",
"CONTENT_LENGTH" => data.length.to_s,
View
2 test/spec_sendfile.rb
@@ -35,7 +35,7 @@ def open_file(path)
unless method_defined?(:to_path)
alias :to_path :path
end
- end.open(path, 'w+')
+ end.open(path, 'wb+')
end
it "does nothing when no X-Sendfile-Type header present" do

0 comments on commit 5497fd2

Please sign in to comment.
Something went wrong with that request. Please try again.