summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider/user
diff options
context:
space:
mode:
authorAndrew Shafer <andrew@reductivelabs.com>2008-09-20 22:00:19 -0600
committerAndrew Shafer <andrew@reductivelabs.com>2008-09-20 22:00:19 -0600
commit27f0c7d6e7bf3400ccecc6512d6a5d477cb9bea9 (patch)
tree35d7f3b864dd24ff3c61e19187655455620fe952 /spec/unit/provider/user
parent7a3a38f58c099244c2a8b490f0b69c2fa63f3e16 (diff)
downloadpuppet-27f0c7d6e7bf3400ccecc6512d6a5d477cb9bea9.tar.gz
puppet-27f0c7d6e7bf3400ccecc6512d6a5d477cb9bea9.tar.xz
puppet-27f0c7d6e7bf3400ccecc6512d6a5d477cb9bea9.zip
fix failing hpux user specs
feature 1508 Not sure these tests ever passed on any platform. Added some mocking to support the two tests.
Diffstat (limited to 'spec/unit/provider/user')
-rwxr-xr-xspec/unit/provider/user/hpux.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/spec/unit/provider/user/hpux.rb b/spec/unit/provider/user/hpux.rb
index 8b31658b8..4129a7ab6 100755
--- a/spec/unit/provider/user/hpux.rb
+++ b/spec/unit/provider/user/hpux.rb
@@ -7,23 +7,19 @@ provider_class = Puppet::Type.type(:user).provider(:hpuxuseradd)
describe provider_class do
# left from the useradd test... I have no clue what I'm doing.
before do
- @resource = stub("resource", :name => "myuser", :managehome? => nil)
+ @resource = stub("resource", :name => "myuser", :managehome? => nil, :should => "fakeval", :[] => "fakeval")
@provider = provider_class.new(@resource)
end
it "should add -F when modifying a user" do
- @resource.stubs(:should).returns "fakeval"
- @resource.stubs(:[]).returns "fakeval"
+ @resource.expects(:allowdupe?).returns true
@provider.expects(:execute).with { |args| args.include?("-F") }
-
- @provider.modify
+ @provider.uid = 1000
end
it "should add -F when deleting a user" do
- @resource.stubs(:should).returns "fakeval"
- @resource.stubs(:[]).returns "fakeval"
+ @provider.stubs(:exists?).returns(true)
@provider.expects(:execute).with { |args| args.include?("-F") }
-
@provider.delete
end
end