summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2010-04-12 11:31:32 -0700
committerLuke Kanies <luke@puppetlabs.com>2010-04-12 11:31:32 -0700
commit1821187f212d88b033d04f8ffe4d37f034e3b4fa (patch)
tree8c75523ef1d3a9dd22f1b144ec5c7bc4735a0417 /spec
parent03532e087946fb4002b218eec477899ffb5860b3 (diff)
downloadpuppet-1821187f212d88b033d04f8ffe4d37f034e3b4fa.tar.gz
puppet-1821187f212d88b033d04f8ffe4d37f034e3b4fa.tar.xz
puppet-1821187f212d88b033d04f8ffe4d37f034e3b4fa.zip
Porting/removing group test/unit tests
Most of it was just complicated, and the rest useless. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/type/group.rb20
1 files changed, 20 insertions, 0 deletions
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