From f909e43bbe1066f0dcf7fdfc7069cb9b9e7e94e7 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Fri, 18 Jul 2014 13:59:49 -0500 Subject: Remove appending :actions and :valid_actions --- lib/chef/resource/lwrp_base.rb | 13 +------------ spec/unit/lwrp_spec.rb | 21 --------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/lib/chef/resource/lwrp_base.rb b/lib/chef/resource/lwrp_base.rb index e173eb09cc..b293b85944 100644 --- a/lib/chef/resource/lwrp_base.rb +++ b/lib/chef/resource/lwrp_base.rb @@ -105,21 +105,10 @@ class Chef if action_names.empty? defined?(@actions) ? @actions : from_superclass(:actions, []).dup else - # BC-compat way for checking if actions have already been defined - if defined?(@actions) - @actions.push(*action_names) - else - @actions = action_names - end + @actions = action_names end end - # @deprecated - def self.valid_actions(*args) - Chef::Log.warn("`valid_actions' is deprecated, please use actions `instead'!") - actions(*args) - end - # Set the run context on the class. Used to provide access to the node # during class definition. def self.run_context=(run_context) diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb index bffec9cace..9a775f2dff 100644 --- a/spec/unit/lwrp_spec.rb +++ b/spec/unit/lwrp_spec.rb @@ -218,27 +218,6 @@ describe "LWRP" do expect(child.default_action).to eq(:dont_eat) end end - - context "when actions are already defined" do - let(:child) do - Class.new(parent) do - actions :eat - actions :sleep - actions :drink - end - end - - def raise_if_deprecated! - if Chef::VERSION.split('.').first.to_i > 11 - raise "This test should be removed and the associated code should be removed!" - end - end - - it "ammends actions when they are already defined" do - raise_if_deprecated! - expect(child.actions).to eq([:eat, :sleep, :drink]) - end - end end end -- cgit v1.2.1