Sha256: 48681237f9acad7f97b83bcf05f7c5c1160b13cc3d3a29882305ef924bb7712f

Contents?: true

Size: 935 Bytes

Versions: 8

Compression:

Stored size: 935 Bytes

Contents

#!/usr/bin/env ruby

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

provider_class = Puppet::Type.type(:group).provider(:groupadd)

describe provider_class do
  before do
    @resource = stub("resource", :name => "mygroup")
    @provider = provider_class.new(@resource)
  end

  # #1360
  it "should add -o when allowdupe is enabled and the group is being created" do
    @resource.stubs(:should).returns "fakeval"
    @resource.stubs(:[]).returns "fakeval"
    @resource.expects(:allowdupe?).returns true
    @provider.expects(:execute).with { |args| args.include?("-o") }

    @provider.create
  end

  it "should add -o when allowdupe is enabled and the gid is being modified" do
    @resource.stubs(:should).returns "fakeval"
    @resource.stubs(:[]).returns "fakeval"
    @resource.expects(:allowdupe?).returns true
    @provider.expects(:execute).with { |args| args.include?("-o") }

    @provider.gid = 150
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puppet-2.6.7 spec/unit/provider/group/groupadd_spec.rb
puppet-2.6.6 spec/unit/provider/group/groupadd_spec.rb
puppet-2.6.5 spec/unit/provider/group/groupadd_spec.rb
puppet-2.6.4 spec/unit/provider/group/groupadd_spec.rb
puppet-2.6.3 spec/unit/provider/group/groupadd_spec.rb
puppet-2.6.2 spec/unit/provider/group/groupadd_spec.rb
puppet-2.6.1 spec/unit/provider/group/groupadd_spec.rb
puppet-2.6.0 spec/unit/provider/group/groupadd_spec.rb