diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-01 17:08:47 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-01 17:08:47 +0000 |
commit | 51a38a24014e35126714e08e3c58a2d696e3ee66 (patch) | |
tree | b7bbe304a82267399145dd369a42d5242edbfcbf /spec | |
parent | b4621c9aaed7e18e377b2e36f41b61f0960997d8 (diff) | |
download | ruby-51a38a24014e35126714e08e3c58a2d696e3ee66.tar.gz |
Open files in binary modes for copying in MSpec's #cp
* See https://bugs.ruby-lang.org/issues/13570.
* Found by MSP-Greg (Greg L).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mspec/lib/mspec/helpers/fs.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/mspec/lib/mspec/helpers/fs.rb b/spec/mspec/lib/mspec/helpers/fs.rb index 2200339bd7..c41389e755 100644 --- a/spec/mspec/lib/mspec/helpers/fs.rb +++ b/spec/mspec/lib/mspec/helpers/fs.rb @@ -1,8 +1,8 @@ class Object # Copies a file def cp(source, dest) - File.open(dest, "w") do |d| - File.open(source, "r") do |s| + File.open(dest, "wb") do |d| + File.open(source, "rb") do |s| while data = s.read(1024) d.write data end |