summaryrefslogtreecommitdiff
path: root/spec/unit/resource
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2015-03-24 15:26:09 +0000
committerBryan McLellan <btm@chef.io>2015-03-27 13:36:09 -0700
commit1be4c8a3adccd9e392ca4af48f171763e06aaca9 (patch)
tree960929abc8862daec62ec263518d8357ec6cae80 /spec/unit/resource
parent312253ebfd88ac57b8433c2f859690068fe7cb14 (diff)
downloadchef-1be4c8a3adccd9e392ca4af48f171763e06aaca9.tar.gz
Ensure link's path attribute works with delayed
Closes #1769, closes #1767
Diffstat (limited to 'spec/unit/resource')
-rw-r--r--spec/unit/resource/link_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/unit/resource/link_spec.rb b/spec/unit/resource/link_spec.rb
index 3573a15f31..51221e0472 100644
--- a/spec/unit/resource/link_spec.rb
+++ b/spec/unit/resource/link_spec.rb
@@ -53,6 +53,21 @@ describe Chef::Resource::Link do
expect(@resource.target_file).to eql("fakey_fakerton")
end
+ it "should accept a delayed evaluator as the target path" do
+ @resource.target_file Chef::DelayedEvaluator.new { "my_lazy_name" }
+ expect(@resource.target_file).to eql("my_lazy_name")
+ end
+
+ it "should accept a delayed evaluator when accessing via 'path'" do
+ @resource.target_file Chef::DelayedEvaluator.new { "my_lazy_name" }
+ expect(@resource.path).to eql("my_lazy_name")
+ end
+
+ it "should accept a delayed evaluator via 'to'" do
+ @resource.to Chef::DelayedEvaluator.new { "my_lazy_name" }
+ expect(@resource.to).to eql("my_lazy_name")
+ end
+
it "should accept a string as the link source via 'to'" do
expect { @resource.to "/tmp" }.not_to raise_error
end