diff options
-rw-r--r-- | lib/chef/platform/handler_map.rb | 5 | ||||
-rw-r--r-- | spec/integration/recipes/recipe_dsl_spec.rb | 15 | ||||
-rw-r--r-- | spec/unit/recipe_spec.rb | 4 |
3 files changed, 0 insertions, 24 deletions
diff --git a/lib/chef/platform/handler_map.rb b/lib/chef/platform/handler_map.rb index 001eb3dc8f..a9551a344b 100644 --- a/lib/chef/platform/handler_map.rb +++ b/lib/chef/platform/handler_map.rb @@ -31,11 +31,6 @@ class Chef # are exactly equal if new_matcher[:value].is_a?(Class) && !new_matcher[:override] cmp = compare_matcher_properties(new_matcher, matcher) { |m| m[:value].name } - if cmp < 0 - Chef::Log.warn "You are overriding #{key} on #{new_matcher[:filters].inspect} with #{new_matcher[:value].inspect}: used to be #{matcher[:value].inspect}. Use override: true if this is what you intended." - elsif cmp > 0 - Chef::Log.warn "You declared a new resource #{new_matcher[:value].inspect} for resource #{key}, but it comes alphabetically after #{matcher[:value].inspect} and has the same filters (#{new_matcher[:filters].inspect}), so it will not be used. Use override: true if you want to use it for #{key}." - end end end cmp diff --git a/spec/integration/recipes/recipe_dsl_spec.rb b/spec/integration/recipes/recipe_dsl_spec.rb index a4de6ae542..fd40e5b6d8 100644 --- a/spec/integration/recipes/recipe_dsl_spec.rb +++ b/spec/integration/recipes/recipe_dsl_spec.rb @@ -794,21 +794,6 @@ describe "Recipe DSL methods" do end end - context "when Thingy9 provides :thingy9" do - before(:context) { - class RecipeDSLSpecNamespace::Thingy9 < BaseThingy - resource_name :thingy9 - end - } - - it "declaring a resource providing the same :thingy9 produces a warning" do - expect(Chef::Log).to receive(:warn).with("You declared a new resource RecipeDSLSpecNamespace::Thingy9AlternateProvider for resource thingy9, but it comes alphabetically after RecipeDSLSpecNamespace::Thingy9 and has the same filters ({}), so it will not be used. Use override: true if you want to use it for thingy9.") - class RecipeDSLSpecNamespace::Thingy9AlternateProvider < BaseThingy - resource_name :thingy9 - end - end - end - context "when Thingy10 provides :thingy10" do before(:context) { class RecipeDSLSpecNamespace::Thingy10 < BaseThingy diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb index 511e7e9397..ea3ab44c16 100644 --- a/spec/unit/recipe_spec.rb +++ b/spec/unit/recipe_spec.rb @@ -154,8 +154,6 @@ describe Chef::Recipe do end it "selects the first one alphabetically" do - expect(Chef::Log).to receive(:warn).with("You declared a new resource TottenhamHotspur for resource football, but it comes alphabetically after Sounders and has the same filters ({:platform=>\"nbc_sports\"}), so it will not be used. Use override: true if you want to use it for football.") - Sounders.provides :football, platform: "nbc_sports" TottenhamHotspur.provides :football, platform: "nbc_sports" @@ -165,8 +163,6 @@ describe Chef::Recipe do end it "selects the first one alphabetically even if the declaration order is reversed" do - expect(Chef::Log).to receive(:warn).with("You are overriding football2 on {:platform=>\"nbc_sports\"} with Sounders: used to be TottenhamHotspur. Use override: true if this is what you intended.") - TottenhamHotspur.provides :football2, platform: "nbc_sports" Sounders.provides :football2, platform: "nbc_sports" |