diff options
author | John Keiser <john@johnkeiser.com> | 2015-05-27 18:01:47 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-06-01 08:02:04 -0700 |
commit | 16dbca593b2fef74d952c5e119313efbe2288670 (patch) | |
tree | cdf5c0e038833788142299edd9a532aca57e551e /spec/integration | |
parent | dfa9b6004e20b4d41bbc9b653e812c5136a336c6 (diff) | |
download | chef-16dbca593b2fef74d952c5e119313efbe2288670.tar.gz |
Toss an error if a resource without a resource_name is created
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/recipes/resource_definition_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/integration/recipes/resource_definition_spec.rb b/spec/integration/recipes/resource_definition_spec.rb new file mode 100644 index 0000000000..da92bb18fa --- /dev/null +++ b/spec/integration/recipes/resource_definition_spec.rb @@ -0,0 +1,21 @@ +require 'support/shared/integration/integration_helper' + +describe "Resource definition" do + include IntegrationSupport + + context "With a resource with no resource_name or provides line" do + before do + Chef::Config[:treat_deprecation_warnings_as_errors] = false + end + + before(:context) { + class Chef::Resource::ResourceDefinitionNoNameTest < Chef::Resource + end + } + it "Creating said resource with the resource builder fails with an exception" do + expect_converge { + resource_definition_no_name_test 'blah' + }.to raise_error(Chef::Exceptions::InvalidResourceSpecification) + end + end +end |