Skip to content
This repository
Browse code

Ensure binary modes are used in tests, for Windows

  • Loading branch information...
commit 5497fd2dfc560ac2c4e33e263e6c29c2ec6b4816 1 parent 60c66b5
James Tucker authored
2  test/spec_multipart.rb
@@ -364,7 +364,7 @@ def rd.length
364 364
   end
365 365
 
366 366
   it "builds complete params with the chunk size of 16384 slicing exactly on boundary" do
367  
-    data = File.open(multipart_file("fail_16384_nofile")) { |f| f.read }.gsub(/\n/, "\r\n")
  367
+    data = File.open(multipart_file("fail_16384_nofile"), 'rb') { |f| f.read }.gsub(/\n/, "\r\n")
368 368
     options = {
369 369
       "CONTENT_TYPE" => "multipart/form-data; boundary=----WebKitFormBoundaryWsY0GnpbI5U7ztzo",
370 370
       "CONTENT_LENGTH" => data.length.to_s,
2  test/spec_sendfile.rb
@@ -35,7 +35,7 @@ def open_file(path)
35 35
       unless method_defined?(:to_path)
36 36
         alias :to_path :path
37 37
       end
38  
-    end.open(path, 'w+')
  38
+    end.open(path, 'wb+')
39 39
   end
40 40
 
41 41
   it "does nothing when no X-Sendfile-Type header present" do

0 notes on commit 5497fd2

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