diff options
author | Tim Smith <tsmith84@gmail.com> | 2019-08-16 13:15:22 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2019-08-16 13:15:22 -0700 |
commit | 54b3cc831750805f19f838d60dea25e23dfa2e8c (patch) | |
tree | 81f539fca05ca2d0ed0761011913cd852b46d450 /spec/unit/plugins/fail_spec.rb | |
parent | 038fd847c6d75dfaf6e60b67de185732aa245cc3 (diff) | |
download | ohai-54b3cc831750805f19f838d60dea25e23dfa2e8c.tar.gz |
rspec updates from rubocop-rspecrspec
Autocorrects for a few different things that rubocop-rspec identified.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/plugins/fail_spec.rb')
-rw-r--r-- | spec/unit/plugins/fail_spec.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/unit/plugins/fail_spec.rb b/spec/unit/plugins/fail_spec.rb index 00ee8ee3..35a0643a 100644 --- a/spec/unit/plugins/fail_spec.rb +++ b/spec/unit/plugins/fail_spec.rb @@ -30,13 +30,13 @@ shared_examples "a v7 loading failure" do end - before(:each) do + before do fail_file = File.open("#{tmp}/plugins/fail.rb", "w+") fail_file.write(failstr) fail_file.close end - after(:each) do + after do File.delete("#{tmp}/plugins/fail.rb") end @@ -48,18 +48,18 @@ shared_examples "a v7 loading failure" do end - before(:each) do + before do @ohai = Ohai::System.new @loader = Ohai::Loader.new(@ohai) end - it "should not have attribute keys" do + it "does not have attribute keys" do @loader.load_plugin("#{tmp}/plugins/fail.rb") # @ohai.attributes.should_not have_key("fail") expect { @ohai.provides_map.find_providers_for(["fail"]) }.to raise_error(Ohai::Exceptions::AttributeNotFound) end - it "should write to Ohai::Log" do + it "writes to Ohai::Log" do expect(@loader.logger).to receive(:warn).once @loader.load_plugin("#{tmp}/plugins/fail.rb") end @@ -74,13 +74,13 @@ shared_examples "a v7 loading success" do end - before(:each) do + before do fail_file = File.open("#{tmp}/plugins/fail.rb", "w+") fail_file.write(failstr) fail_file.close end - after(:each) do + after do File.delete("#{tmp}/plugins/fail.rb") end @@ -92,17 +92,17 @@ shared_examples "a v7 loading success" do end - before(:each) do + before do @ohai = Ohai::System.new @loader = Ohai::Loader.new(@ohai) end - it "should have attribute keys" do + it "has attribute keys" do @loader.load_plugin("#{tmp}/plugins/fail.rb") expect(@ohai.provides_map).to have_key("fail") end - it "should not write to Ohai::Log" do + it "does not write to Ohai::Log" do expect(@loader.logger).not_to receive(:warn) @loader.load_plugin("#{tmp}/plugins/fail.rb") end @@ -117,13 +117,13 @@ shared_examples "a v7 run failure" do end - before(:each) do + before do fail_file = File.open("#{tmp}/plugins/fail.rb", "w+") fail_file.write(failstr) fail_file.close end - after(:each) do + after do File.delete("#{tmp}/plugins/fail.rb") end @@ -135,17 +135,17 @@ shared_examples "a v7 run failure" do end - before(:each) do + before do @ohai = Ohai::System.new @loader = Ohai::Loader.new(@ohai) end - it "should not have new attribute keys" do + it "does not have new attribute keys" do @loader.load_plugin("#{tmp}/plugins/fail.rb").new(@ohai).run expect(@ohai.provides_map).not_to have_key("other") end - it "should write to Ohai::Log" do + it "writes to Ohai::Log" do expect(@loader.logger).to receive(:warn).once @loader.load_plugin("#{tmp}/plugins/fail.rb").new(@ohai).run end |