Skip to content

Commit

Permalink
Merge pull request #190 from jshraibman-mdsol/fix/abs_coverage_dir
Browse files Browse the repository at this point in the history
Allow coverage_dir to be an absolute path
  • Loading branch information
colszowka committed Sep 11, 2013
2 parents 79ee0aa + 0feb9a1 commit e228353
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions features/config_coverage_dir.feature
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/simplecov/configuration.rb
Expand Up @@ -35,7 +35,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
Expand Down

0 comments on commit e228353

Please sign in to comment.