summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-02 18:52:58 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-02 18:52:58 -0800
commit467e6b8840cb83f646bf5a062c805a28658346c5 (patch)
treed1d05a7b8514a1575ee0fa89d9390e130056857d
parentcbb0a78d9b3f860943b11a3769c7cfff91f4e820 (diff)
downloadchef-lcg/resource-apply.tar.gz
verify first block/proc argument is the resourcelcg/resource-apply
-rw-r--r--spec/unit/resource_spec.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index ccdf3827d3..fd23aac65b 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -1103,20 +1103,30 @@ describe Chef::Resource do
let(:resource) { Chef::Resource::ZenMaster.new("coffee", run_context) }
it "allows setting with a block" do
- resource.apply do
+ rspec = self
+ resource.apply do |r|
+ rspec.expect(r).to rspec.be_kind_of(Chef::Resource::ZenMaster)
something "meow"
end
expect(resource.something).to eql("meow")
end
it "allows setting with a proc" do
- prop = proc { something "meow" }
+ rspec = self
+ prop = proc do |r|
+ rspec.expect(r).to rspec.be_kind_of(Chef::Resource::ZenMaster)
+ something "meow"
+ end
resource.apply prop
expect(resource.something).to eql("meow")
end
it "allows setting with a lambda" do
- prop = lambda { |ign| something "meow" }
+ rspec = self
+ prop = lambda do |r|
+ rspec.expect(r).to rspec.be_kind_of(Chef::Resource::ZenMaster)
+ something "meow"
+ end
resource.apply prop
expect(resource.something).to eql("meow")
end