If I remember correctly, I was basing this off of the existing tests. Not
quite sure how to do this since I want to make sure groupadd is called.


On Mon, Oct 7, 2013 at 12:45 PM, Adrien Thebo <notifications@github.com>wrote:

> In spec/unit/provider/group/gpasswd_spec.rb:
>
> > +        provider.create
> > +      end
> > +    end
> > +
> > +    describe "on system that do not feature system_groups", :unless => described_class.system_groups? do
> > +      it "should not add -r when system is enabled and the group is being created" do
> > +        resource[:system] = :true
> > +        provider.expects(:execute).with('/usr/sbin/groupadd mygroup')
> > +        provider.create
> > +      end
> > +    end
> > +
> > +    describe "when adding additional group members to the group" do
> > +      it "should pass all members individually as group add options to gpasswd" do
> > +        resource[:members] = ['test_one','test_two','test_three']
> > +        provider.expects(:execute).with() { |value|
>
> This is the outcome of using shellwords to run a set of commands; the
> tests are very tightly coupled with the implementation which makes the
> tests brittle. We should be testing the interface, not the implementation.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/puppetlabs/puppet/pull/1848/files#r6802660>
> .
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaughan@onyxpoint.com

-- This account not approved for unencrypted proprietary information --