summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-14 22:18:36 -0600
committerLuke Kanies <luke@madstop.com>2009-02-14 22:18:36 -0600
commit21a714aa75ff896fa67160a5ceaa26b6c0df98f5 (patch)
tree5ed2113df29ea1303dfcde3ac09272e45f9ae6b4 /spec/unit
parent327ee17d607937dec007482d1c81bae63c01bf52 (diff)
downloadpuppet-21a714aa75ff896fa67160a5ceaa26b6c0df98f5.tar.gz
puppet-21a714aa75ff896fa67160a5ceaa26b6c0df98f5.tar.xz
puppet-21a714aa75ff896fa67160a5ceaa26b6c0df98f5.zip
Fixing some tests that somehow broke in the merge to master
I expect these failed in master but not 0.24.x because I'm better about stubbing calls to Facter in master. I stubbed these enough that they should continue to work. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/type/user.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/unit/type/user.rb b/spec/unit/type/user.rb
index 5c46689d3..57af7f093 100755
--- a/spec/unit/type/user.rb
+++ b/spec/unit/type/user.rb
@@ -70,10 +70,14 @@ describe user do
describe "when retrieving all current values" do
before do
- @user = user.new(:name => "foo", :uid => 10, :gid => 10)
+ @user = user.new(:name => "foo", :uid => 10)
end
it "should return a hash containing values for all set properties" do
+ @user[:gid] = 10
+ @user.property(:ensure).expects(:retrieve).returns :present
+ @user.property(:uid).expects(:retrieve).returns 15
+ @user.property(:gid).expects(:retrieve).returns 15
values = @user.retrieve
[@user.property(:uid), @user.property(:gid)].each { |property| values.should be_include(property) }
end
@@ -230,7 +234,7 @@ describe user do
end
it "should fail if a ':' is included in the password" do
- lambda { @password.should = "some:thing" }.should raise_error(ArgumentError)
+ lambda { @password.should = "some:thing" }.should raise_error(Puppet::Error)
end
it "should allow the value to be set to :absent" do
@@ -262,6 +266,7 @@ describe user do
config = Puppet::Resource::Catalog.new :testing do |conf|
[testuser, testrole].each { |resource| conf.add_resource resource }
end
+ Puppet::Type::User::ProviderDirectoryservice.stubs(:get_macosx_version_major).returns "10.5"
rel = testuser.autorequire[0]
rel.source.ref.should == testrole.ref