[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

Andrew Shafer andrew at reductivelabs.com
Fri Jan 23 14:21:54 UTC 2009


The following commit has been merged in the master branch:
commit c398db1e6f9eb3e0f7c9296116564b0a6ffb7777
Author: Andrew Shafer <andrew at reductivelabs.com>
Date:   Tue Dec 2 13:57:33 2008 -0700

    Bug #1780 Fixing meaningless test
    
    Gave meaning to test dependent on feature for role property

diff --git a/spec/unit/type/user.rb b/spec/unit/type/user.rb
index e408376..de04371 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

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list