summaryrefslogtreecommitdiff
path: root/spec/functional/resource/group_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/functional/resource/group_spec.rb')
-rw-r--r--spec/functional/resource/group_spec.rb20
1 files changed, 8 insertions, 12 deletions
diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb
index ea9aa5c2b7..525a5e842d 100644
--- a/spec/functional/resource/group_spec.rb
+++ b/spec/functional/resource/group_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Chirag Jog (<chirag@clogeny.com>)
# Author:: Siddheshwar More (<siddheshwar.more@clogeny.com>)
-# Copyright:: Copyright 2013-2016, Chef Software Inc.
+# Copyright:: Copyright 2013-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,16 +21,12 @@ require "spec_helper"
require "functional/resource/base"
require "chef/mixin/shell_out"
-# Chef::Resource::Group are turned off on Mac OS X 10.6 due to caching
-# issues around Etc.getgrnam() not picking up the group membership
-# changes that are done on the system. Etc.endgrent is not functioning
-# correctly on certain 10.6 boxes.
-describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supported_on_mac_osx_106 do
+describe Chef::Resource::Group, :requires_root_or_running_windows do
include Chef::Mixin::ShellOut
def group_should_exist(group)
- case ohai[:platform_family]
- when "debian", "fedora", "rhel", "suse", "gentoo", "slackware", "arch"
+ case ohai[:os]
+ when "linux"
expect { Etc.getgrnam(group) }.not_to raise_error
expect(group).to eq(Etc.getgrnam(group).name)
when "windows"
@@ -54,8 +50,8 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
end
def group_should_not_exist(group)
- case ohai[:platform_family]
- when "debian", "fedora", "rhel", "suse", "gentoo", "slackware", "arch"
+ case ohai[:os]
+ when "linux"
expect { Etc.getgrnam(group) }.to raise_error(ArgumentError, "can't find group for #{group}")
when "windows"
expect { Chef::Util::Windows::NetGroup.new(group).local_get_members }.to raise_error(ArgumentError, /The group name could not be found./)
@@ -297,8 +293,8 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
end
let(:group_name) { "group#{SecureRandom.random_number(9999)}" }
- let(:included_members) { nil }
- let(:excluded_members) { nil }
+ let(:included_members) { [] }
+ let(:excluded_members) { [] }
let(:group_resource) do
group = Chef::Resource::Group.new(group_name, run_context)
group.members(included_members)