diff options
| author | Markus Reiter | 2017-02-27 16:34:26 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-27 16:36:02 +0100 |
| commit | 83c1b399468ddbe51b9c1b2decd09a4a6bb0342a (patch) | |
| tree | 72b47bd0996667157b8fa9bc4971d199418c5948 /Library | |
| parent | 0dfe85df1376097ae966f6d710df716ad9a38ff2 (diff) | |
| download | brew-83c1b399468ddbe51b9c1b2decd09a4a6bb0342a.tar.bz2 | |
Use `around` hook for shared "integration test" context.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb | 18 |
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 |
