summaryrefslogtreecommitdiff
path: root/spec/unit/resource/link_spec.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-05-16 12:48:05 -0700
committerTim Smith <tsmith@chef.io>2018-05-16 15:45:33 -0700
commit69687a927da48b169262e3b961fd2c12e6723574 (patch)
treea0744c8401a4ae32ed489c65a3cfd57d3b784b67 /spec/unit/resource/link_spec.rb
parentb69877bb0f1b2aec99f9c0a392d064e2b0d21bda (diff)
downloadchef-69687a927da48b169262e3b961fd2c12e6723574.tar.gz
Add additional resource specs
Auto generated from the resource inspector Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/resource/link_spec.rb')
-rw-r--r--spec/unit/resource/link_spec.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/spec/unit/resource/link_spec.rb b/spec/unit/resource/link_spec.rb
index 4f4f8c7c9f..05a39835d8 100644
--- a/spec/unit/resource/link_spec.rb
+++ b/spec/unit/resource/link_spec.rb
@@ -26,22 +26,17 @@ describe Chef::Resource::Link do
expect_any_instance_of(Chef::Resource::Link).to receive(:verify_links_supported!).and_return(true)
end
- it "has a name property" do
- expect(resource.name).to eql("fakey_fakerton")
+ it "the target_file property is the name_property" do
+ expect(resource.target_file).to eql("fakey_fakerton")
end
- it "has a default action of 'create'" do
+ it "sets the default action as :create" do
expect(resource.action).to eql([:create])
end
- { :create => false, :delete => false, :blues => true }.each do |action, bad_value|
- it "should #{bad_value ? 'not' : ''} accept #{action}" do
- if bad_value
- expect { resource.action action }.to raise_error(ArgumentError)
- else
- expect { resource.action action }.not_to raise_error
- end
- end
+ it "supports :create, :delete actions" do
+ expect { resource.action :create }.not_to raise_error
+ expect { resource.action :delete }.not_to raise_error
end
it "uses the object name as the target_file by default" do