diff options
author | Markus Roberts <Markus@reality.com> | 2010-06-23 15:51:08 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-06-23 22:27:29 -0700 |
commit | 51b70c05167399eb2274fc1add18b6b18d31429d (patch) | |
tree | 1a33b11f0f589d6f5cd806d6da9de317887ca0e6 /spec/unit/provider/group/groupadd_spec.rb | |
parent | 9958c805dd90acadbb56ed3095e665d8afa990cd (diff) | |
download | puppet-51b70c05167399eb2274fc1add18b6b18d31429d.tar.gz puppet-51b70c05167399eb2274fc1add18b6b18d31429d.tar.xz puppet-51b70c05167399eb2274fc1add18b6b18d31429d.zip |
[#3994] rename the specs to have _spec.rb at the end
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
Diffstat (limited to 'spec/unit/provider/group/groupadd_spec.rb')
-rwxr-xr-x | spec/unit/provider/group/groupadd_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/unit/provider/group/groupadd_spec.rb b/spec/unit/provider/group/groupadd_spec.rb new file mode 100755 index 000000000..fb4b811cb --- /dev/null +++ b/spec/unit/provider/group/groupadd_spec.rb @@ -0,0 +1,31 @@ +#!/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 |