summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/type/user.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/unit/type/user.rb b/spec/unit/type/user.rb
index 6f01ab35a..e40837635 100755
--- a/spec/unit/type/user.rb
+++ b/spec/unit/type/user.rb
@@ -238,4 +238,15 @@ describe user do
lambda { @ensure.should = :role }.should_not raise_error
end
end
+
+ describe "when user has roles" do
+ it "should autorequire roles" do
+ testuser = Puppet.type(:user).create(:name => "testuser", :roles => "testrole")
+ testrole = Puppet.type(:user).create(:name => "testrole")
+ config = Puppet::Node::Catalog.new :testing do |conf|
+ [testuser, testrole].each { |resource| conf.add_resource resource }
+ end
+ testuser.autorequire
+ end
+ end
end