summaryrefslogtreecommitdiff
path: root/spec/functional/resource/file_spec.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-11-06 15:04:39 -0800
committerdanielsdeleo <dan@opscode.com>2012-11-06 15:04:39 -0800
commit426068030e077736c47dd9139e4dd5a3ce2fc680 (patch)
tree107f1280815fe00c62dc51f61f71fb957ce33c49 /spec/functional/resource/file_spec.rb
parente0c58ca87f3e8dd72dc86efce922cd1b0ba21abf (diff)
downloadchef-426068030e077736c47dd9139e4dd5a3ce2fc680.tar.gz
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.
Diffstat (limited to 'spec/functional/resource/file_spec.rb')
-rw-r--r--spec/functional/resource/file_spec.rb7
1 files changed, 3 insertions, 4 deletions
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