diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-06 19:06:23 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-06 19:06:23 -0800 |
commit | 3e9b626b750fa7fd91c5cdad169992a606120d7b (patch) | |
tree | 5eb550341009b8c5ec43c2680f5d52773a8c8db5 /spec/unit/resource_spec.rb | |
parent | 29c39b56764a52945609b0eeb0f6068da6ed0041 (diff) | |
download | chef-3e9b626b750fa7fd91c5cdad169992a606120d7b.tar.gz |
remove most of supports API
still there on service (where it makes some sense)
also still on mount (because i have no idea if that is actively being
used or if it makes any sense at all).
converts it to a property on mount + service as well.
also removed setting it as an array -- did we ever document that and/or
does anyone use it? i'm not religiously against that way of setting
it, but if nobody ever used it i'd rather remove the YAGNI.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rw-r--r-- | spec/unit/resource_spec.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 2f75ba0241..0f8540b855 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -3,7 +3,7 @@ # Author:: Christopher Walters (<cw@chef.io>) # Author:: Tim Hinderliter (<tim@chef.io>) # Author:: Seth Chisamore (<schisamo@chef.io>) -# Copyright:: Copyright 2008-2016, Chef Software Inc. +# Copyright:: Copyright 2008-2017, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -192,7 +192,6 @@ describe Chef::Resource do describe "load_from" do let(:prior_resource) do prior_resource = Chef::Resource.new("funk") - prior_resource.supports(:funky => true) prior_resource.source_line prior_resource.allowed_actions << :funkytown prior_resource.action(:funkytown) @@ -205,7 +204,6 @@ describe Chef::Resource do it "should load the attributes of a prior resource" do resource.load_from(prior_resource) - expect(resource.supports).to eq({ :funky => true }) end it "should not inherit the action from the prior resource" do @@ -481,7 +479,7 @@ describe Chef::Resource do let(:resource_class) { Class.new(Chef::Resource) { property :a, default: 1 } } it "should include the default in the hash" do expect(resource.to_hash.keys.sort).to eq([:a, :allowed_actions, :params, :provider, :updated, - :updated_by_last_action, :before, :supports, + :updated_by_last_action, :before, :noop, :ignore_failure, :name, :source_line, :action, :retries, :retry_delay, :elapsed_time, :default_guard_interpreter, :guard_interpreter, :sensitive].sort) @@ -493,7 +491,7 @@ describe Chef::Resource do it "should convert to a hash" do hash = resource.to_hash expected_keys = [ :allowed_actions, :params, :provider, :updated, - :updated_by_last_action, :before, :supports, + :updated_by_last_action, :before, :noop, :ignore_failure, :name, :source_line, :action, :retries, :retry_delay, :elapsed_time, :default_guard_interpreter, :guard_interpreter, :sensitive ] @@ -512,18 +510,6 @@ describe Chef::Resource do end end - describe "supports" do - it "should allow you to set what features this resource supports" do - support_hash = { :one => :two } - resource.supports(support_hash) - expect(resource.supports).to eql(support_hash) - end - - it "should return the current value of supports" do - expect(resource.supports).to eq({}) - end - end - describe "ignore_failure" do it "should default to throwing an error if a provider fails for a resource" do expect(resource.ignore_failure).to eq(false) |