summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Danna <steve@opscode.com>2015-01-20 08:51:05 +0000
committerSteven Danna <steve@opscode.com>2015-01-27 09:01:10 +0000
commit66ec7a39c4a040b98f61d0b2862079c506d74537 (patch)
tree5fb4cd1fa5d51af0f2f6d376acf97cd7659c68a5
parent10c4bc75e6cf35875f8c37c124cb4d8f62b4dfdd (diff)
downloadchef-ssd/file-verification.tar.gz
Fix Chef::Resource::File::Verification tests on Windowsssd/file-verification
-rw-r--r--spec/unit/resource/file/verification_spec.rb6
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