summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/unit/mixin/enforce_ownership_and_permissions_spec.rb20
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)