summaryrefslogtreecommitdiff
path: root/spec/unit/util/suidmanager_spec.rb
diff options
context:
space:
mode:
authorStig Sandbeck Mathisen <ssm@debian.org>2012-01-26 11:22:40 +0100
committerStig Sandbeck Mathisen <ssm@debian.org>2012-01-26 11:22:40 +0100
commitc17b3ba16e7013f06416f10b8752ef783f048717 (patch)
tree790f13f167199b954007e17d1c55a8d1b0218775 /spec/unit/util/suidmanager_spec.rb
parent32af6143486ceb24a93636445d1883f5fe2299d7 (diff)
downloadpuppet-upstream/2.7.10.tar.gz
Imported Upstream version 2.7.10upstream/2.7.10
Diffstat (limited to 'spec/unit/util/suidmanager_spec.rb')
-rwxr-xr-xspec/unit/util/suidmanager_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/unit/util/suidmanager_spec.rb b/spec/unit/util/suidmanager_spec.rb
index 45a351f1b..575762f3c 100755
--- a/spec/unit/util/suidmanager_spec.rb
+++ b/spec/unit/util/suidmanager_spec.rb
@@ -308,3 +308,22 @@ describe Puppet::Util::SUIDManager do
end
end
end
+
+describe 'Puppet::Util::SUIDManager#groups=' do
+ subject do
+ Puppet::Util::SUIDManager
+ end
+
+
+ it "(#3419) should rescue Errno::EINVAL on OS X" do
+ Process.expects(:groups=).raises(Errno::EINVAL, 'blew up')
+ subject.expects(:osx_maj_ver).returns('10.7').twice
+ subject.groups = ['list', 'of', 'groups']
+ end
+
+ it "(#3419) should fail if an Errno::EINVAL is raised NOT on OS X" do
+ Process.expects(:groups=).raises(Errno::EINVAL, 'blew up')
+ subject.expects(:osx_maj_ver).returns(false)
+ expect { subject.groups = ['list', 'of', 'groups'] }.should raise_error(Errno::EINVAL)
+ end
+end