diff options
author | Steven Danna <steve@opscode.com> | 2015-01-20 08:51:05 +0000 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2015-02-17 08:47:02 -0500 |
commit | aa9b233614da81c506929cc1c36eb509a4e2c97e (patch) | |
tree | a06dfe37dffc8d8d8374e4dd9932ab513c751061 | |
parent | 73c0cf7dafb0ac38263bd598f026924fff4dc5a6 (diff) | |
download | chef-aa9b233614da81c506929cc1c36eb509a4e2c97e.tar.gz |
Fix Chef::Resource::File::Verification tests on Windows
-rw-r--r-- | spec/unit/resource/file/verification_spec.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/resource/file/verification_spec.rb b/spec/unit/resource/file/verification_spec.rb index 8e40a50cb8..3609d9d482 100644 --- a/spec/unit/resource/file/verification_spec.rb +++ b/spec/unit/resource/file/verification_spec.rb @@ -70,7 +70,11 @@ describe Chef::Resource::File::Verification do context "with a verification command(String)" do it "substitutes \%{file} with the path" do - test_command = "test #{temp_path} = %{file}" + test_command = if windows? + "if \"#{temp_path}\" == \"%{file}\" (exit 0) else (exit 1)" + else + "test #{temp_path} = %{file}" + end v = Chef::Resource::File::Verification.new(parent_resource, test_command, {}) expect(v.verify(temp_path)).to eq(true) end |