Skip to content

Commit

Permalink
Merge pull request #18 from jonas054/bugfix2
Browse files Browse the repository at this point in the history
Added coverage task, which runs simplecov.
  • Loading branch information
bbatsov committed Jan 20, 2013
2 parents 618625f + 0719769 commit fbb0b52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Rakefile
Expand Up @@ -31,9 +31,10 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
desc 'Run RSpec with code coverage'
task :coverage do
ENV['COVERAGE'] = 'true'
Rake::Task['spec'].execute
end

task :default => :spec
Expand Down
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
@@ -1,5 +1,10 @@
# encoding: utf-8

if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
Expand Down

0 comments on commit fbb0b52

Please sign in to comment.