spec/unit/plugins/windows/fips_spec.rb in ohai-15.2.5 vs spec/unit/plugins/windows/fips_spec.rb in ohai-15.3.1

- old
+ new

@@ -18,20 +18,20 @@ require "spec_helper" require "openssl" describe Ohai::System, "plugin fips" do - let(:enabled) { 0 } - let(:plugin) { get_plugin("windows/fips") } - let(:openssl_test_mode) { false } - subject do plugin.run plugin["fips"]["kernel"]["enabled"] end - before(:each) do + let(:enabled) { 0 } + let(:plugin) { get_plugin("windows/fips") } + let(:openssl_test_mode) { false } + + before do allow(plugin).to receive(:collect_os).and_return(:windows) end around do |ex| @@ -42,16 +42,18 @@ end context "with OpenSSL.fips_mode == false" do before { allow(OpenSSL).to receive(:fips_mode).and_return(false) } + it "does not set fips plugin" do expect(subject).to be(false) end end context "with OpenSSL.fips_mode == true" do before { allow(OpenSSL).to receive(:fips_mode).and_return(true) } + it "sets fips plugin" do expect(subject).to be(true) end end end