diff options
author | Paul Berry <paul@puppetlabs.com> | 2011-02-01 17:23:23 -0800 |
---|---|---|
committer | Paul Berry <paul@puppetlabs.com> | 2011-02-01 17:23:23 -0800 |
commit | ed1359902d14a0ca89dac5debee756209b0bd433 (patch) | |
tree | 03337bc864c01fffe2e2c9b2210b6425f71caf16 /spec/unit/resource_spec.rb | |
parent | 526335cff0f47c1efc25ffda535e2ead10f10fac (diff) | |
parent | 87c5c30fe8d2bbc31dabeb7383f5e5703a732bc5 (diff) | |
download | puppet-ed1359902d14a0ca89dac5debee756209b0bd433.tar.gz puppet-ed1359902d14a0ca89dac5debee756209b0bd433.tar.xz puppet-ed1359902d14a0ca89dac5debee756209b0bd433.zip |
Merge remote branch 'bodepd/feature/2.6.4/5910' into 2.6.next
* bodepd/feature/2.6.4/5910:
(#5910) Improved logging when declared classes cannot be found:
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rwxr-xr-x | spec/unit/resource_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 877b6b6b0..ff31b2492 100755 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -98,6 +98,14 @@ describe Puppet::Resource do lambda { Puppet::Resource.new("foo") }.should raise_error(ArgumentError) end + it 'should fail if strict is set and type does not exist' do + lambda { Puppet::Resource.new('foo', 'title', {:strict=>true}) }.should raise_error(ArgumentError, 'Invalid resource type foo') + end + + it 'should fail if strict is set and class does not exist' do + lambda { Puppet::Resource.new('Class', 'foo', {:strict=>true}) }.should raise_error(ArgumentError, 'Could not find declared class foo') + end + it "should fail if the title is a hash and the type is not a valid resource reference string" do lambda { Puppet::Resource.new({:type => "foo", :title => "bar"}) }.should raise_error(ArgumentError, 'Puppet::Resource.new does not take a hash as the first argument. Did you mean ("foo", "bar") ?' |