diff options
Diffstat (limited to 'spec/unit/client_spec.rb')
-rw-r--r-- | spec/unit/client_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index d348c24385..2aff7b2a71 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -38,12 +38,23 @@ describe Chef::Client do end it "runs ohai with only the minimum required plugins" do - expected_filter = %w{fqdn machinename hostname platform platform_version os os_version} + expected_filter = %w{fqdn machinename hostname platform platform_version ohai_time os os_version} expect(ohai_system).to receive(:all_plugins).with(expected_filter) client.run_ohai end end + context "when Ohai tells us to fail" do + it "fails" do + ohai_system = Ohai::System.new + module Ohai::Exceptions + class CriticalPluginFailure < Error; end + end + expect(ohai_system).to receive(:all_plugins) { raise Ohai::Exceptions::CriticalPluginFailure } + expect { client.run_ohai }.to raise_error(SystemExit) + end + end + describe "authentication protocol selection" do context "when FIPS is disabled" do before do |