From b64b8382a07514e3f0a973937720807a66986807 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Fri, 16 Sep 2016 14:27:27 -0700 Subject: Make 12.5+ custom resources whyrun safe by default. (This was always intended to be the case, and it's difficult to do it yourself. We have been teaching people whyrun-safe methods to make resources right alongside Custom Resources, as well.) --- spec/integration/recipes/resource_action_spec.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/integration/recipes/resource_action_spec.rb b/spec/integration/recipes/resource_action_spec.rb index f4f275e937..60d5831a50 100644 --- a/spec/integration/recipes/resource_action_spec.rb +++ b/spec/integration/recipes/resource_action_spec.rb @@ -17,6 +17,22 @@ module ResourceActionSpec expect(ActionJackson.succeeded).to eq true end + context "when running in whyrun mode" do + before do + Chef::Config[:why_run] = true + end + + it "the default action runs" do + converge <<-EOM, __FILE__, __LINE__ + 1 + #{resource_dsl} "hi" do + foo "foo!" + end + EOM + expect(ActionJackson.ran_action).to eq :access_recipe_dsl + expect(ActionJackson.succeeded).to eq true + end + end + it "the action can access recipe DSL" do converge <<-EOM, __FILE__, __LINE__ + 1 #{resource_dsl} "hi" do @@ -141,7 +157,7 @@ module ResourceActionSpec action :access_recipe_dsl do ActionJackson.ran_action = :access_recipe_dsl - ruby_block "hi there" do + whyrun_safe_ruby_block "hi there" do block do ActionJackson.succeeded = true end -- cgit v1.2.1