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