spec/unit/plugins/abort_spec.rb in ohai-14.15.0 vs spec/unit/plugins/abort_spec.rb in ohai-15.0.35

- old
+ new

@@ -14,11 +14,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -require_relative "../../spec_helper.rb" +require "spec_helper" tmp = ENV["TMPDIR"] || ENV["TMP"] || ENV["TEMP"] || "/tmp" abortstr = <<~EOF Ohai.plugin(:Abort) do @@ -29,15 +29,15 @@ end EOF describe "a plug-in that aborts execution" do before(:all) do - begin - Dir.mkdir("#{tmp}/plugins") - rescue Errno::EEXIST + + Dir.mkdir("#{tmp}/plugins") + rescue Errno::EEXIST # ignore - end + end before(:each) do fail_file = File.open("#{tmp}/plugins/abort.rb", "w+") fail_file.write(abortstr) @@ -47,14 +47,14 @@ after(:each) do File.delete("#{tmp}/plugins/abort.rb") end after(:all) do - begin - Dir.delete("#{tmp}/plugins") - rescue + + Dir.delete("#{tmp}/plugins") + rescue # ignore - end + end before(:each) do @ohai = Ohai::System.new @loader = Ohai::Loader.new(@ohai)