diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-09-08 17:16:40 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-09-08 17:16:40 -0700 |
commit | 0cc0ae46270da20b3bd9045550df2d4fd9ae145f (patch) | |
tree | def399e4500421bac25dfb60e2f7dca74c771efa /spec/unit/mixin | |
parent | eac543b05437f6ee1d9f98cc2656e55a189c2934 (diff) | |
download | chef-0cc0ae46270da20b3bd9045550df2d4fd9ae145f.tar.gz |
Modify enforce_ownership_and_permissions_spec to be more unit-likejdm/enforce-owner-unitify
Diffstat (limited to 'spec/unit/mixin')
-rw-r--r-- | spec/unit/mixin/enforce_ownership_and_permissions_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb b/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb index aeef175ff9..408926293e 100644 --- a/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +++ b/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb @@ -49,12 +49,12 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do allow_any_instance_of(Chef::FileAccessControl).to receive(:uid_from_resource).and_return(0) allow_any_instance_of(Chef::FileAccessControl).to receive(:requires_changes?).and_return(false) allow_any_instance_of(Chef::FileAccessControl).to receive(:define_resource_requirements) + allow_any_instance_of(Chef::FileAccessControl).to receive(:describe_changes) + + passwd_struct = OpenStruct.new(:name => "root", :passwd => "x", + :uid => 0, :gid => 0, :dir => '/root', + :shell => '/bin/bash') - passwd_struct = if windows? - Struct::Passwd.new("root", "x", 0, 0, "/root", "/bin/bash") - else - Struct::Passwd.new("root", "x", 0, 0, "root", "/root", "/bin/bash") - end group_struct = OpenStruct.new(:name => "root", :passwd => "x", :gid => 0) allow(Etc).to receive(:getpwuid).and_return(passwd_struct) allow(Etc).to receive(:getgrgid).and_return(group_struct) @@ -73,12 +73,12 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do before do allow_any_instance_of(Chef::FileAccessControl).to receive(:requires_changes?).and_return(true) allow_any_instance_of(Chef::FileAccessControl).to receive(:uid_from_resource).and_return(0) + allow_any_instance_of(Chef::FileAccessControl).to receive(:describe_changes) + + passwd_struct = OpenStruct.new(:name => "root", :passwd => "x", + :uid => 0, :gid => 0, :dir => '/root', + :shell => '/bin/bash') - passwd_struct = if windows? - Struct::Passwd.new("root", "x", 0, 0, "/root", "/bin/bash") - else - Struct::Passwd.new("root", "x", 0, 0, "root", "/root", "/bin/bash") - end group_struct = OpenStruct.new(:name => "root", :passwd => "x", :gid => 0) allow(Etc).to receive(:getpwuid).and_return(passwd_struct) allow(Etc).to receive(:getgrgid).and_return(group_struct) |