summaryrefslogtreecommitdiff
path: root/spec/unit/resource_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-01-12 15:13:40 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2015-01-12 15:13:59 -0800
commit5a2f19a85fbee9f4517aa471378e40cf32d030e0 (patch)
tree6c1824aee7a5f9de882e1e8096d9b6c7e050b663 /spec/unit/resource_spec.rb
parent153764d26ed639dfd58945fdc5c4cc5ae51ef5e2 (diff)
downloadchef-5a2f19a85fbee9f4517aa471378e40cf32d030e0.tar.gz
Skip 3694 warnings on trivial resource cloning
Turns the 3694 warning into a debug message if the prior resource is identical to the current resource. Suggestion for opscode/chef-rfc#76 This also moves resource building out to its own class.
Diffstat (limited to 'spec/unit/resource_spec.rb')
-rw-r--r--spec/unit/resource_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 79d47ad4dc..56c7401c92 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -162,7 +162,7 @@ describe Chef::Resource do
end
end
- describe "load_prior_resource" do
+ describe "load_from" do
before(:each) do
@prior_resource = Chef::Resource.new("funk")
@prior_resource.supports(:funky => true)
@@ -174,12 +174,12 @@ describe Chef::Resource do
end
it "should load the attributes of a prior resource" do
- @resource.load_prior_resource(@resource.resource_name, @resource.name)
+ @resource.load_from(@prior_resource)
expect(@resource.supports).to eq({ :funky => true })
end
it "should not inherit the action from the prior resource" do
- @resource.load_prior_resource(@resource.resource_name, @resource.name)
+ @resource.load_from(@prior_resource)
expect(@resource.action).not_to eq(@prior_resource.action)
end
end