Use around hook for shared "integration test" context.

This commit is contained in:
Markus Reiter 2017-02-27 16:34:26 +01:00
parent 0dfe85df13
commit 83c1b39946

View File

@ -38,15 +38,17 @@ RSpec.shared_context "integration test" do
end end
end end
before(:each) do around(:each) do |example|
begin
(HOMEBREW_PREFIX/"bin").mkpath (HOMEBREW_PREFIX/"bin").mkpath
FileUtils.touch HOMEBREW_PREFIX/"bin/brew" FileUtils.touch HOMEBREW_PREFIX/"bin/brew"
end
after(:each) do example.run
ensure
FileUtils.rm HOMEBREW_PREFIX/"bin/brew" FileUtils.rm HOMEBREW_PREFIX/"bin/brew"
FileUtils.rmdir HOMEBREW_PREFIX/"bin" FileUtils.rmdir HOMEBREW_PREFIX/"bin"
end end
end
# Generate unique ID to be able to # Generate unique ID to be able to
# properly merge coverage results. # properly merge coverage results.