diff options
| author | Markus Reiter | 2017-02-27 17:50:54 +0100 |
|---|---|---|
| committer | GitHub | 2017-02-27 17:50:54 +0100 |
| commit | bb18f5251628059a45f55f1e1fcfcd9819dd4ed1 (patch) | |
| tree | 31420099e20a5a666a2110720740acc9558ebc73 /Library/Homebrew/test | |
| parent | b2289e54d6e7c9b038b701e9a7c5882f6fe0b2fd (diff) | |
| parent | 83c1b399468ddbe51b9c1b2decd09a4a6bb0342a (diff) | |
| download | brew-bb18f5251628059a45f55f1e1fcfcd9819dd4ed1.tar.bz2 | |
Merge pull request #2215 from reitermarkus/spec-integration-test-helper
Use `around` hook for shared "integration test" context.
Diffstat (limited to 'Library/Homebrew/test')
| -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 |
