aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/testing_env.rb
diff options
context:
space:
mode:
authorJack Nagel2012-08-29 15:51:13 -0500
committerJack Nagel2012-08-29 15:56:36 -0500
commit6f1c1b96f7c5f984a082e358098f9ceabc1e5e31 (patch)
treed6249225c42987c54df924b72f35ca8c84d9b7ab /Library/Homebrew/test/testing_env.rb
parent67108d402f6211ae8c482539b4c2493ad6275d39 (diff)
downloadhomebrew-6f1c1b96f7c5f984a082e358098f9ceabc1e5e31.tar.bz2
tests: support "rake rcov" if rcov is installed
If the rcov gem is installed, `rake rcov` will generate a test coverage report in the coverage directory. I picked rcov because it is 1.8 compatible. But it could easily be swapped out for another coverage tool. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/test/testing_env.rb')
-rw-r--r--Library/Homebrew/test/testing_env.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index 9a760cf23..7042b77e1 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -25,8 +25,13 @@ HOMEBREW_CURL_ARGS = '-fsLA'
MACOS_VERSION=10.6
(HOMEBREW_PREFIX+'Library/Formula').mkpath
+
+prevwd = Dir.pwd
Dir.chdir HOMEBREW_PREFIX
-at_exit { HOMEBREW_PREFIX.parent.rmtree }
+at_exit do
+ Dir.chdir prevwd
+ HOMEBREW_PREFIX.parent.rmtree
+end
# Test fixtures and files can be found relative to this path
TEST_FOLDER = Pathname.new(ABS__FILE__).parent.realpath