summaryrefslogtreecommitdiff
path: root/spec/unit/recipe_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-10-16 10:21:26 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-10-16 10:46:47 -0700
commitbde7d1337add8837d9ff656e85df84f87bd8caee (patch)
tree3d02c93d9342239c188d38b6d23142ece1b6bb14 /spec/unit/recipe_spec.rb
parent35be3bf49622b2514b1d04a8ab8bfab8121f7041 (diff)
downloadchef-bde7d1337add8837d9ff656e85df84f87bd8caee.tar.gz
add test for retval from definition
Diffstat (limited to 'spec/unit/recipe_spec.rb')
-rw-r--r--spec/unit/recipe_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 5b6f3ea55b..e29ad47045 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -345,6 +345,17 @@ describe Chef::Recipe do
end
recipe.resources(:zen_master => "lao tzu").something.should eql(false)
end
+
+ it "should return the last statement in the definition as the retval" do
+ crow_define = Chef::ResourceDefinition.new
+ crow_define.define :crow, :peace => false, :something => true do
+ "the return val"
+ end
+ run_context.definitions[:crow] = crow_define
+ recipe.crow "mine" do
+ peace true
+ end.should eql("the return val")
+ end
end
end