summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Shafer <andrew@reductivelabs.com>2008-12-02 13:57:33 -0700
committerAndrew Shafer <andrew@reductivelabs.com>2008-12-02 13:58:47 -0700
commitc398db1e6f9eb3e0f7c9296116564b0a6ffb7777 (patch)
treef2957cd528267c1a10f026bc6010d78c652547c0
parent278bfe83015312292360f727d6532a143610db0d (diff)
downloadpuppet-c398db1e6f9eb3e0f7c9296116564b0a6ffb7777.tar.gz
puppet-c398db1e6f9eb3e0f7c9296116564b0a6ffb7777.tar.xz
puppet-c398db1e6f9eb3e0f7c9296116564b0a6ffb7777.zip
Bug #1780 Fixing meaningless test
Gave meaning to test dependent on feature for role property
-rwxr-xr-xspec/unit/type/user.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/unit/type/user.rb b/spec/unit/type/user.rb
index e40837635..de04371ed 100755
--- a/spec/unit/type/user.rb
+++ b/spec/unit/type/user.rb
@@ -241,12 +241,20 @@ describe user do
describe "when user has roles" do
it "should autorequire roles" do
- testuser = Puppet.type(:user).create(:name => "testuser", :roles => "testrole")
+ #this is a little funky because the autorequire depends on a property with a feature
+ testuser = Puppet.type(:user).create(:name => "testuser")
+ testuser.provider.class.expects(:feature?).with(:manages_solaris_rbac).returns(true)
+ 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
+
+ rel = testuser.autorequire[0]
+ rel.source.ref.should == testrole.ref
+ rel.target.ref.should == testuser.ref
end
end
end