diff options
author | danielsdeleo <dan@opscode.com> | 2012-11-16 16:28:49 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2012-11-19 14:05:15 -0800 |
commit | d068ae1842ee1690db21c92654d51e0959cda8b4 (patch) | |
tree | 6d05d897e7163a932ffdce6c32b56467f693c860 /spec/functional/resource/cookbook_file_spec.rb | |
parent | 9b39d2ca14733fe082fcd6e05d6c928219726d07 (diff) | |
download | chef-d068ae1842ee1690db21c92654d51e0959cda8b4.tar.gz |
fixes binmode issues on windows
Diffstat (limited to 'spec/functional/resource/cookbook_file_spec.rb')
-rw-r--r-- | spec/functional/resource/cookbook_file_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/functional/resource/cookbook_file_spec.rb b/spec/functional/resource/cookbook_file_spec.rb index 89efccc064..b2bee5d95b 100644 --- a/spec/functional/resource/cookbook_file_spec.rb +++ b/spec/functional/resource/cookbook_file_spec.rb @@ -24,7 +24,13 @@ describe Chef::Resource::CookbookFile do let(:file_base) { 'cookbook_file_spec' } let(:source) { 'java.response' } let(:cookbook_name) { 'java' } - let(:expected_content) { IO.read(File.join(CHEF_SPEC_DATA, 'cookbooks', 'java', 'files', 'default', 'java.response')) } + let(:expected_content) do + content = File.open(File.join(CHEF_SPEC_DATA, 'cookbooks', 'java', 'files', 'default', 'java.response'), "rb") do |f| + f.read + end + content.force_encoding(Encoding::BINARY) if content.respond_to?(:force_encoding) + content + end def create_resource # set up cookbook collection for this run to use, based on our |