diff options
author | danielsdeleo <dan@opscode.com> | 2012-11-06 15:04:39 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2012-11-06 15:04:39 -0800 |
commit | 426068030e077736c47dd9139e4dd5a3ce2fc680 (patch) | |
tree | 107f1280815fe00c62dc51f61f71fb957ce33c49 /spec/support/shared/functional/securable_resource.rb | |
parent | e0c58ca87f3e8dd72dc86efce922cd1b0ba21abf (diff) | |
download | chef-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/support/shared/functional/securable_resource.rb')
-rw-r--r-- | spec/support/shared/functional/securable_resource.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index 2eeb16c784..3c95cce2dc 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -74,12 +74,14 @@ shared_examples_for "a securable resource" do it "should set an owner", :requires_root do resource.owner expected_user_name resource.run_action(:create) + resource.should be_updated_by_last_action File.lstat(path).uid.should == expected_uid end it "should set a group", :requires_root do resource.group desired_gid resource.run_action(:create) + resource.should be_updated_by_last_action File.lstat(path).gid.should == expected_gid end @@ -87,6 +89,7 @@ shared_examples_for "a securable resource" do mode_string = '776' resource.mode mode_string resource.run_action(:create) + resource.should be_updated_by_last_action pending('Linux does not support lchmod', :if => resource.instance_of?(Chef::Resource::Link) && !os_x? && !freebsd?) do (File.lstat(path).mode & 007777).should == (mode_string.oct & 007777) end @@ -96,6 +99,7 @@ shared_examples_for "a securable resource" do mode_integer = 0776 resource.mode mode_integer resource.run_action(:create) + resource.should be_updated_by_last_action pending('Linux does not support lchmod', :if => resource.instance_of?(Chef::Resource::Link) && !os_x? && !freebsd?) do (File.lstat(path).mode & 007777).should == (mode_integer & 007777) end |