From bde7d1337add8837d9ff656e85df84f87bd8caee Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Thu, 16 Oct 2014 10:21:26 -0700 Subject: add test for retval from definition --- spec/unit/recipe_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- cgit v1.2.1