From f5bcbf07e513eb06fe0729cd02e8d6dacc8e628c Mon Sep 17 00:00:00 2001 From: Joseph Shraibman Date: Sat, 12 Jan 2013 21:38:23 -0500 Subject: [PATCH 1/2] Failing scenario --- features/config_coverage_dir.feature | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/features/config_coverage_dir.feature b/features/config_coverage_dir.feature index 0d29018d..038456d2 100644 --- a/features/config_coverage_dir.feature +++ b/features/config_coverage_dir.feature @@ -18,3 +18,16 @@ Feature: When I successfully run `bundle exec rake test` Then a coverage report should have been generated in "test/simplecov" And a directory named "coverage" should not exist + + Scenario: + Given SimpleCov for Test/Unit is configured with: + """ + require 'simplecov' + SimpleCov.start do + coverage_dir '/tmp/test/simplecov' + end + """ + + When I successfully run `bundle exec rake test` + Then a coverage report should have been generated in "/tmp/test/simplecov" + And a directory named "coverage" should not exist From 0feb9a1631c23432278e520f97e5dab3e5a433ed Mon Sep 17 00:00:00 2001 From: Joseph Shraibman Date: Sat, 12 Jan 2013 21:49:40 -0500 Subject: [PATCH 2/2] Allow coverage_dir to be absolute --- lib/simplecov/configuration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/simplecov/configuration.rb b/lib/simplecov/configuration.rb index 960aab78..a24da6fc 100644 --- a/lib/simplecov/configuration.rb +++ b/lib/simplecov/configuration.rb @@ -34,7 +34,7 @@ def coverage_dir(dir=nil) # values. Will create the directory if it's missing # def coverage_path - coverage_path = File.join(root, coverage_dir) + coverage_path = File.expand_path(coverage_dir, root) FileUtils.mkdir_p coverage_path coverage_path end