summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-08-19 17:04:20 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-08-24 11:36:21 +1000
commit5ee660276f3e4f6519b1257673fa690be0416fbd (patch)
tree6336a07820f0623afc6a463d7c875f5808d9b4ce /spec
parent06fcece75ef52168a73013eba2b8bfc50cf71c97 (diff)
Adding an 'exists?' delegator from user type to provider
We need this knowledge from the Settings class, and it makes more sense to delegate than to use direct access to the provider. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/type/user.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/type/user.rb b/spec/unit/type/user.rb
index bf2af23ab..deabd4746 100755
--- a/spec/unit/type/user.rb
+++ b/spec/unit/type/user.rb
@@ -41,6 +41,12 @@ describe user do
it "should have a valid provider" do
user.new(:name => "foo").provider.class.ancestors.should be_include(Puppet::Provider)
end
+
+ it "should delegate existence questions to its provider" do
+ instance = user.new(:name => "foo")
+ instance.provider.expects(:exists?).returns "eh"
+ instance.exists?.should == "eh"
+ end
end
properties = [:ensure, :uid, :gid, :home, :comment, :shell, :password, :groups, :roles, :auths, :profiles, :project, :keys]