Use around hook for shared "integration test" context.
This commit is contained in:
parent
0dfe85df13
commit
83c1b39946
@ -38,14 +38,16 @@ RSpec.shared_context "integration test" do
|
||||
end
|
||||
end
|
||||
|
||||
before(:each) do
|
||||
(HOMEBREW_PREFIX/"bin").mkpath
|
||||
FileUtils.touch HOMEBREW_PREFIX/"bin/brew"
|
||||
end
|
||||
around(:each) do |example|
|
||||
begin
|
||||
(HOMEBREW_PREFIX/"bin").mkpath
|
||||
FileUtils.touch HOMEBREW_PREFIX/"bin/brew"
|
||||
|
||||
after(:each) do
|
||||
FileUtils.rm HOMEBREW_PREFIX/"bin/brew"
|
||||
FileUtils.rmdir HOMEBREW_PREFIX/"bin"
|
||||
example.run
|
||||
ensure
|
||||
FileUtils.rm HOMEBREW_PREFIX/"bin/brew"
|
||||
FileUtils.rmdir HOMEBREW_PREFIX/"bin"
|
||||
end
|
||||
end
|
||||
|
||||
# Generate unique ID to be able to
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user