diff options
author | Tim Smith <tsmith@chef.io> | 2018-02-16 08:41:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-16 08:41:18 -0800 |
commit | 02eeb371e2c556623400eee0e8476be58ba88478 (patch) | |
tree | ca2a38d41c50bdbe0ffa726520b7e09411cab1f3 | |
parent | c99299bcc4820f195766a2421270af33e999b0da (diff) | |
parent | c12a70ecbacaeb23e098ddf0d1b432da5752f0dc (diff) | |
download | ohai-02eeb371e2c556623400eee0e8476be58ba88478.tar.gz |
Merge pull request #1135 from chef/tm/bad_tests_2
fix critical plugin tests
-rw-r--r-- | spec/unit/system_spec.rb | 9 |
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 |