diff options
author | Luke Kanies <luke@madstop.com> | 2009-02-14 11:55:20 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-14 12:24:42 -0600 |
commit | 682dd8b933c5feeed389b644b75f27e66e863276 (patch) | |
tree | 0b389d83a65115a36e676bfe6735c89adeadee32 /spec/unit | |
parent | 44f97aa5815d4a8ab73302bd75b85e045f9944c4 (diff) | |
download | puppet-682dd8b933c5feeed389b644b75f27e66e863276.tar.gz puppet-682dd8b933c5feeed389b644b75f27e66e863276.tar.xz puppet-682dd8b933c5feeed389b644b75f27e66e863276.zip |
Fixing password validation to support symbols.
My fix for #1920 broke when you set :absent
or :present.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-x | spec/unit/type/user.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/unit/type/user.rb b/spec/unit/type/user.rb index 15a3e2532..dadcc65ef 100755 --- a/spec/unit/type/user.rb +++ b/spec/unit/type/user.rb @@ -40,10 +40,6 @@ describe user do it "should have a valid provider" do user.create(:name => "foo").provider.class.ancestors.should be_include(Puppet::Provider) end - - it "should fail if a ':' is included in the password" do - lambda { user.create(:name => "foo", :password => 'some:thing') }.should raise_error(Puppet::Error) - end end properties = [:ensure, :uid, :gid, :home, :comment, :shell, :password, :groups, :roles, :auths, :profiles, :project, :keys] @@ -235,6 +231,14 @@ describe user do it "should not include the password in the change log when changing the password" do @password.change_to_s("other", "mypass").should_not be_include("mypass") end + + it "should fail if a ':' is included in the password" do + lambda { @password.should = "some:thing" }.should raise_error(ArgumentError) + end + + it "should allow the value to be set to :absent" do + lambda { @password.should = :absent }.should_not raise_error + end end describe "when manages_solaris_rbac is enabled" do |