[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5-303-gfcfa26a

Jesse Wolfe jes5199 at gmail.com
Thu Mar 17 10:49:16 UTC 2011


The following commit has been merged in the upstream branch:
commit cd5deda8f9eefbe55c63c97c81293d01ca05c110
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Wed Mar 9 16:00:17 2011 -0800

    (#2645) Adding a less-stubby test to verify the "system" attribute's behavior
    
    Paired-with: Jacob Helwig <jacob at puppetlabs.com>

diff --git a/spec/unit/provider/user/user_role_add_spec.rb b/spec/unit/provider/user/user_role_add_spec.rb
index 9cf6492..f739423 100644
--- a/spec/unit/provider/user/user_role_add_spec.rb
+++ b/spec/unit/provider/user/user_role_add_spec.rb
@@ -115,6 +115,7 @@ describe provider_class do
   describe "when allow duplicate is enabled" do
     before do
       @resource.expects(:allowdupe?).returns true
+      @resource.stubs(:system?)
       @provider.stubs(:is_role?).returns(false)
       @provider.stubs(:execute)
       @provider.expects(:execute).with { |args| args.include?("-o") }
diff --git a/spec/unit/provider/user/useradd_spec.rb b/spec/unit/provider/user/useradd_spec.rb
index 81ad7d4..fd75c43 100755
--- a/spec/unit/provider/user/useradd_spec.rb
+++ b/spec/unit/provider/user/useradd_spec.rb
@@ -132,11 +132,6 @@ describe provider_class do
       @provider.addcmd
     end
 
-    it "should check and add if it's a system user" do
-      @provider.expects(:check_system_users).returns([])
-      @provider.addcmd
-    end
-
     it "should check and add if home is managed" do
       @provider.expects(:check_manage_home).returns([])
       @provider.addcmd
@@ -147,6 +142,18 @@ describe provider_class do
       @provider.addcmd
     end
 
+    it "should return an array with -r if system? is true" do
+      resource = Puppet::Type.type(:user).new( :name => "bob", :system => true)
+
+      provider_class.new( resource ).addcmd.should include("-r")
+    end
+
+    it "should return an array without -r if system? is false" do
+      resource = Puppet::Type.type(:user).new( :name => "bob", :system => false)
+
+      provider_class.new( resource ).addcmd.should_not include("-r")
+    end
+
     it "should return an array with full command" do
       @provider.stubs(:command).with(:add).returns("useradd")
       @provider.stubs(:add_properties).returns(["-G", "somegroup"])

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list