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 12:48:35 -0700
commitf3b34f2ad21934b060a95ac59f1573cea7217124 (patch)
tree266a6a950c7b2ef08bf93be4da41ab769267cd6f /spec/unit/resource/link_spec.rb
parentb69877bb0f1b2aec99f9c0a392d064e2b0d21bda (diff)
downloadchef-f3b34f2ad21934b060a95ac59f1573cea7217124.tar.gz
Add resource specs round 1test_defaults
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