From 1821187f212d88b033d04f8ffe4d37f034e3b4fa Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 12 Apr 2010 11:31:32 -0700 Subject: Porting/removing group test/unit tests Most of it was just complicated, and the rest useless. Signed-off-by: Luke Kanies --- spec/unit/type/group.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'spec/unit') diff --git a/spec/unit/type/group.rb b/spec/unit/type/group.rb index fad7a0c48..0bd7c513d 100755 --- a/spec/unit/type/group.rb +++ b/spec/unit/type/group.rb @@ -30,10 +30,30 @@ describe Puppet::Type.type(:group) do @class.attrtype(param).should == :property end end + + it "should convert gids provided as strings into integers" do + @class.new(:name => "foo", :gid => "15")[:gid].should == 15 + end + + it "should accepts gids provided as integers" do + @class.new(:name => "foo", :gid => 15)[:gid].should == 15 + end end # #1407 - we need to declare the allowdupe param as boolean. it "should have a boolean method for determining if duplicates are allowed" do @class.new(:name => "foo").methods.should be_include("allowdupe?") end + + it "should call 'create' to create the group" do + group = @class.new(:name => "foo", :ensure => :present) + group.provider.expects(:create) + group.parameter(:ensure).sync + end + + it "should call 'delete' to remove the group" do + group = @class.new(:name => "foo", :ensure => :absent) + group.provider.expects(:delete) + group.parameter(:ensure).sync + end end -- cgit