summaryrefslogtreecommitdiffstats
path: root/spec/unit/type/user_spec.rb
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-02-02 16:47:53 -0800
committerMatt Robinson <matt@puppetlabs.com>2011-02-02 16:47:53 -0800
commitd4a468543f1f06d44efdb7e375284b0e65260caf (patch)
tree2dff58c6e2af2cd682a1143af8494ee4bdf99964 /spec/unit/type/user_spec.rb
parent6d9cae2e9ca6a56506f679db02ba9abb30a4df91 (diff)
parent876d0503dd93329a73e7f335c10a47330d745293 (diff)
downloadpuppet-d4a468543f1f06d44efdb7e375284b0e65260caf.tar.gz
puppet-d4a468543f1f06d44efdb7e375284b0e65260caf.tar.xz
puppet-d4a468543f1f06d44efdb7e375284b0e65260caf.zip
Merge branch '2.6.x' into next
* 2.6.x: (46 commits) Augmentation of tests for prior commit Fix to fix for #5755 -- backref serialization issues in zaml Fixed #5564 - Added some more fqdn_rand documentation Fixed #4968 - Updated list of options turned on by --test in documentation (#5061) - allow special hostclass/define variables to be evaluated as defaults. (#6107) Fix an error when auditing a file with empty content Remove already initialized constant warning from file_spec.rb tests (#5566) Treat source only File checksums as syntax errors when used with content Rename variable used in File type validation to be more clear Remove invalid "timestamp" and "time", and add missing "ctime" File checksum types. Remove order dependency when specifying source and checksum on File type Bug #5755 -- ZAML generates extra newline in some hash backreferences. bug #5681 -- code fix to handle AIX mount output Bug #5681 -- parse AIX mount command output. Spec for #5681 to allow parsing of AIX mount output in mount provider Fixed #6091 - Changed POSIX path matching to allow multiple leading slashes Bug #6091 -- test leading double-slash in filenames are allowed. Fixed #6071 - Fixed typo and improved exec path error message Fixed #6061 - Allowed -1 as password min/max age Bug #6061 -- verify that negative {min,max}_password_age are accepted. ... Manually Resolved Conflicts: lib/puppet/util/zaml.rb spec/unit/util/zaml_spec.rb
Diffstat (limited to 'spec/unit/type/user_spec.rb')
-rwxr-xr-xspec/unit/type/user_spec.rb34
1 files changed, 31 insertions, 3 deletions
diff --git a/spec/unit/type/user_spec.rb b/spec/unit/type/user_spec.rb
index b834f2011..117c90f1c 100755
--- a/spec/unit/type/user_spec.rb
+++ b/spec/unit/type/user_spec.rb
@@ -201,21 +201,21 @@ describe user do
it "should return true if no 'should' values are set" do
@gid = user.attrclass(:gid).new(:resource => @resource)
- @gid.must be_insync(500)
+ @gid.must be_safe_insync(500)
end
it "should return true if any of the specified groups are equal to the current integer" do
Puppet::Util.expects(:gid).with("foo").returns 300
Puppet::Util.expects(:gid).with("bar").returns 500
- @gid.must be_insync(500)
+ @gid.must be_safe_insync(500)
end
it "should return false if none of the specified groups are equal to the current integer" do
Puppet::Util.expects(:gid).with("foo").returns 300
Puppet::Util.expects(:gid).with("bar").returns 500
- @gid.should_not be_insync(700)
+ @gid.should_not be_safe_insync(700)
end
end
@@ -245,6 +245,34 @@ describe user do
end
end
+ describe "when managing minimum password age" do
+ before do
+ @age = user.attrclass(:password_min_age).new(:resource => @resource)
+ end
+
+ it "should accept a negative minimum age" do
+ expect { @age.should = -1 }.should_not raise_error
+ end
+
+ it "should fail with an empty minimum age" do
+ expect { @age.should = '' }.should raise_error(Puppet::Error)
+ end
+ end
+
+ describe "when managing maximum password age" do
+ before do
+ @age = user.attrclass(:password_max_age).new(:resource => @resource)
+ end
+
+ it "should accept a negative maximum age" do
+ expect { @age.should = -1 }.should_not raise_error
+ end
+
+ it "should fail with an empty maximum age" do
+ expect { @age.should = '' }.should raise_error(Puppet::Error)
+ end
+ end
+
describe "when managing passwords" do
before do
@password = user.attrclass(:password).new(:resource => @resource, :should => "mypass")