summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2012-08-28 13:41:10 -0400
committerBryan McLellan <btm@loftninjas.org>2012-08-28 13:41:55 -0400
commitd2f836d34dcbd02baa5a3bb775e6bca454d4d6dd (patch)
treeabcb9aff18d16ee1d3aa583a66dac3b16b116155
parentcb59812ec437a97b448f32af5740ea67428596b5 (diff)
downloadchef-d2f836d34dcbd02baa5a3bb775e6bca454d4d6dd.tar.gz
CHEF-3391: update scan_access_control tests for windows
Windows doesn't have Etc, so we should test for its results
-rw-r--r--chef/spec/unit/scan_access_control_spec.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/chef/spec/unit/scan_access_control_spec.rb b/chef/spec/unit/scan_access_control_spec.rb
index dfd7e3b74e..00e2e2669a 100644
--- a/chef/spec/unit/scan_access_control_spec.rb
+++ b/chef/spec/unit/scan_access_control_spec.rb
@@ -63,14 +63,25 @@ describe Chef::ScanAccessControl do
@current_resource.mode.should == "644"
end
- it "sets the group of the current resource to the current group as a String" do
- @current_resource.group.should == Etc.getgrgid(0).name
+ context "on unix", :unix_only do
+ it "sets the group of the current resource to the current group as a String" do
+ @current_resource.group.should == Etc.getgrgid(0).name
+ end
+
+ it "sets the owner of the current resource to the current owner as a String" do
+ @current_resource.user.should == "root"
+ end
end
- it "sets the owner of the current resource to the current owner as a String" do
- @current_resource.user.should == "root"
+ context "on windows", :windows_only do
+ it "sets the group of the current resource to the current group as a String" do
+ @current_resource.group.should == 0
+ end
+
+ it "sets the owner of the current resource to the current owner as a String" do
+ @current_resource.user.should == 0
+ end
end
-
end
describe "when new_resource specifies the mode with a string" do