aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
index 2eb98826a..671ffe73c 100644
--- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
+++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
@@ -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
-
- after(:each) do
- FileUtils.rm HOMEBREW_PREFIX/"bin/brew"
- FileUtils.rmdir HOMEBREW_PREFIX/"bin"
+ around(:each) do |example|
+ begin
+ (HOMEBREW_PREFIX/"bin").mkpath
+ FileUtils.touch HOMEBREW_PREFIX/"bin/brew"
+
+ example.run
+ ensure
+ FileUtils.rm HOMEBREW_PREFIX/"bin/brew"
+ FileUtils.rmdir HOMEBREW_PREFIX/"bin"
+ end
end
# Generate unique ID to be able to