summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider/user/hpux.rb
blob: 4129a7ab667e0d14a3e46e3adcd4763f5b119249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../../../spec_helper'

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, :should => "fakeval", :[] => "fakeval")
        @provider = provider_class.new(@resource)
    end

    it "should add -F when modifying a user" do
        @resource.expects(:allowdupe?).returns true
        @provider.expects(:execute).with { |args| args.include?("-F") }
        @provider.uid = 1000
    end

    it "should add -F when deleting a user" do
        @provider.stubs(:exists?).returns(true)
        @provider.expects(:execute).with { |args| args.include?("-F") }
        @provider.delete
    end
end