From 426068030e077736c47dd9139e4dd5a3ce2fc680 Mon Sep 17 00:00:00 2001 From: danielsdeleo Date: Tue, 6 Nov 2012 15:04:39 -0800 Subject: assert starting state, remove atime checks Chef will nearly always change the atime when inspecting the current state of the file; previous tests were passing by accident. --- spec/functional/resource/file_spec.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'spec/functional/resource/file_spec.rb') diff --git a/spec/functional/resource/file_spec.rb b/spec/functional/resource/file_spec.rb index 903c4cf22f..8e481d9fc4 100644 --- a/spec/functional/resource/file_spec.rb +++ b/spec/functional/resource/file_spec.rb @@ -69,16 +69,15 @@ describe Chef::Resource::File do @expected_checksum = sha256_checksum(path) + now = Time.now.to_i + File.utime(now - 9000, now - 9000, path) @expected_mtime = File.stat(path).mtime - @expected_atime = File.stat(path).atime - sleep 1 resource.run_action(:touch) end - it "updates the mtime/atime of the file" do + it "updates the mtime of the file" do File.stat(path).mtime.should > @expected_mtime - File.stat(path).atime.should > @expected_atime end it "does not change the content" do -- cgit v1.2.1