Skip to content

Commit

Permalink
Add rcov rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Jun 9, 2011
1 parent 10d0a34 commit b449346
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ require 'bundler/gem_tasks'

Dir.glob('lib/tasks/*.rake').each { |r| import r }

require 'rake'
require 'rcov/rcovtask'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

task :rcov => ["functional"] do
desc "Generate code coverage"
RSpec::Core::RakeTask.new(:rcov) do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
t.rcov = true
t.rcov_opts = ['--exclude', 'spec', '--exclude', 'gems']
end

RSpec::Core::RakeTask.new(:spec)

task :clean do
puts 'Cleaning old coverage.data'
FileUtils.rm('coverage.data') if(File.exists? 'coverage.data')
Expand Down

0 comments on commit b449346

Please sign in to comment.