diff options
-rw-r--r-- | lib/chef/resource/lwrp_base.rb | 13 | ||||
-rw-r--r-- | lib/chef/version.rb | 9 | ||||
-rw-r--r-- | spec/unit/knife/core/bootstrap_context_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/lwrp_spec.rb | 21 |
4 files changed, 10 insertions, 35 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/lib/chef/version.rb b/lib/chef/version.rb index 05b57b0301..ea1002ee37 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -17,7 +17,14 @@ class Chef CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__))) - VERSION = '11.16.0.alpha.0' + VERSION = '12.0.0.alpha.0' end +# # NOTE: the Chef::Version class is defined in version_class.rb +# +# NOTE: DO NOT Use the Chef::Version class on Chef::VERSIONs. The +# Chef::Version class is for _cookbooks_ only, and cannot handle +# pre-release chef-client versions like "10.14.0.rc.2". Please +# use Rubygem's Gem::Version class instead. +# diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb index 9cabc59719..d78b48cad3 100644 --- a/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/spec/unit/knife/core/bootstrap_context_spec.rb @@ -194,7 +194,7 @@ EXPECTED describe "when a bootstrap_version is not specified" do it "should send the latest current to the installer" do # Intentionally hard coded in order not to replicate the logic. - bootstrap_context.latest_current_chef_version_string.should eq("-v 11") + bootstrap_context.latest_current_chef_version_string.should eq("-v #{Chef::VERSION.to_i}") end end end 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 |