diff options
author | John Keiser <john@johnkeiser.com> | 2016-01-22 14:20:38 -0800 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2016-01-22 14:20:38 -0800 |
commit | 9b33d77a80db0143db21d132bad0e220c47786b5 (patch) | |
tree | db40eae28b1f1d3895607417a80ef5f83b152e99 /spec/integration | |
parent | 1cb9cc67b71d21d1207602d1ec50ad2d68486171 (diff) | |
download | chef-9b33d77a80db0143db21d132bad0e220c47786b5.tar.gz |
Fix #4334: don't warn about ambiguous property usage
unless using properties on the resource
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/recipes/resource_action_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/integration/recipes/resource_action_spec.rb b/spec/integration/recipes/resource_action_spec.rb index b8c533b31d..a0cc346988 100644 --- a/spec/integration/recipes/resource_action_spec.rb +++ b/spec/integration/recipes/resource_action_spec.rb @@ -436,6 +436,34 @@ describe "Resource.action" do end + context "With a resource with a set_or_return property named group (same name as a resource)" do + class ResourceActionSpecWithGroupAction < Chef::Resource + resource_name :resource_action_spec_set_group_to_nil + action :set_group_to_nil do + # Access x during converge to ensure that we emit no warnings there + resource_action_spec_with_group 'hi' do + group nil + action :nothing + end + end + end + + class ResourceActionSpecWithGroup < Chef::Resource + resource_name :resource_action_spec_with_group + def group(value=nil) + set_or_return(:group, value, {}) + end + end + + it "Setting group to nil in an action does not emit a warning about it being defined in two places" do + expect_recipe { + resource_action_spec_set_group_to_nil "hi" do + action :set_group_to_nil + end + }.to emit_no_warnings_or_errors + end + end + context "When a resource has a property with the same name as another resource" do class HasPropertyNamedTemplate < Chef::Resource use_automatic_resource_name |