summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-02-16 16:10:11 +0000
committerThom May <thom@chef.io>2018-02-16 16:10:23 +0000
commitc12a70ecbacaeb23e098ddf0d1b432da5752f0dc (patch)
treeca2a38d41c50bdbe0ffa726520b7e09411cab1f3
parentc99299bcc4820f195766a2421270af33e999b0da (diff)
downloadohai-tm/bad_tests_2.tar.gz
fix critical plugin teststm/bad_tests_2
Signed-off-by: Thom May <thom@chef.io>
-rw-r--r--spec/unit/system_spec.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb
index 9212e145..57341e76 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -213,19 +213,22 @@ EOF
end
describe "when using :critical_plugins" do
+ # if called from cli is true, we'll exit these tests
+ let(:ohai) { Ohai::System.new() }
+
before do
Ohai.config[:critical_plugins] = [ :Fails ]
end
+
after do
Ohai.config[:critical_plugins] = []
end
it "should fail when critical plugins fail" do
Ohai.config[:plugin_path] = [ path_to(".") ]
- expect(Ohai::Log).to receive(:error).with(/marked as critical/)
- ohai.all_plugins
+ expect { ohai.all_plugins }.to raise_error(Ohai::Exceptions::CriticalPluginFailure,
+ "The following Ohai plugins marked as critical failed: [:Fails]. Failing Chef run.")
end
-
end
end
end