spec/unit/application_spec.rb in ohai-15.2.5 vs spec/unit/application_spec.rb in ohai-15.3.1

- old
+ new

@@ -22,16 +22,16 @@ RSpec.describe "Ohai::Application" do let(:argv) { [] } let(:app) { Ohai::Application.new } - before(:each) do + before do @original_argv = ARGV ARGV.replace(argv) end - after(:each) do + after do ARGV.replace(@original_argv) end describe "#configure_ohai" do describe "loading configuration from a file" do @@ -39,11 +39,11 @@ let(:config_loader) { instance_double("ChefConfig::WorkstationConfigLoader") } context "when specified on the command line" do let(:argv) { [ "-c", config_file ] } - before(:each) do + before do if windows? expect(ChefConfig::WorkstationConfigLoader).to receive(:new) .with("C:#{config_file}", Ohai::Log) .and_return(config_loader) else @@ -66,11 +66,11 @@ end end end context "when a local workstation config exists" do - before(:each) do + before do expect(ChefConfig::WorkstationConfigLoader).to receive(:new) .with(nil, Ohai::Log) .and_return(config_loader) end @@ -84,10 +84,10 @@ context "when CLI options are provided" do let(:argv) { [ "-d", directory ] } let(:directory) { "/some/fantastic/plugins" } it "does not generate deprecated config warnings for cli options" do - expect(Ohai::Log).to_not receive(:warn) + expect(Ohai::Log).not_to receive(:warn) .with(/Ohai::Config\[:directory\] is deprecated/) app.configure_ohai end end