diff options
author | Bryan McLellan <btm@loftninjas.org> | 2014-09-12 16:52:33 -0400 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2014-09-30 20:13:28 -0400 |
commit | eb82af0476f627b1107f272544109d7b847490ad (patch) | |
tree | ae709d39c68cf6ead50fc3e4bae7002e8a0e54ea | |
parent | 6591d4b2ea640cc838bcfd7ff667ed1e9966486f (diff) | |
download | chef-eb82af0476f627b1107f272544109d7b847490ad.tar.gz |
Improve tests for no conditional cases
The tests that ensured we didn't run a conditional when it wasn't specified
had no expectations, so they would always have passed.
-rw-r--r-- | spec/unit/resource_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 7a88c7ff09..e85633eaab 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -464,7 +464,8 @@ describe Chef::Resource do end it "does not run only_if if no only_if command is given" do - @resource.not_if.clear + expect_any_instance_of(Chef::Resource::Conditional).not_to receive(:evaluate) + @resource.only_if.clear @resource.run_action(:purr) end @@ -506,6 +507,8 @@ describe Chef::Resource do end it "does not run not_if if no not_if command is given" do + expect_any_instance_of(Chef::Resource::Conditional).not_to receive(:evaluate) + @resource.not_if.clear @resource.run_action(:purr) end @@ -551,7 +554,6 @@ describe Chef::Resource do expect { resource.guard_interpreter(:command_dot_com) }.not_to raise_error end end - end describe "should_skip?" do |