1
0
Fork 0

Replaced rcov by simplecov

This commit is contained in:
mgawlista 2012-04-08 14:29:39 +02:00
parent 9b3e49d111
commit 3041c7f094
5 changed files with 37 additions and 6 deletions

View File

@ -3,7 +3,6 @@ source "http://rubygems.org"
group :development do
gem "bundler", "~> 1.0.0"
gem "jeweler", "~> 1.6.4"
gem "rcov", ">= 0"
gem "rdoc", ">= 0"
gem "shoulda"
@ -12,4 +11,6 @@ group :development do
gem "webmock"
end
gem 'simplecov', :require => false, :group => :test
gem "nokogiri", ">= 0"

View File

@ -69,6 +69,7 @@ MusicBrainz::Track
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* to get a coverage report for your Test Unit and RSpec tests use the rake tasks: test_coverage, rspec_coverage
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
=== Copyright

View File

@ -32,12 +32,21 @@ Rake::TestTask.new(:test) do |test|
test.verbose = true
end
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |test|
test.verbose = true
test.rcov_opts << '--exclude "gems/*"'
end
desc "Run Test Unit with code coverage"
task :test_coverage do
ENV['COVERAGE'] = 'true'
Rake::Task["test"].execute
end
desc "Run RSpec with code coverage"
task :rspec_coverage do
ENV['COVERAGE'] = 'true'
Rake::Task["spec"].execute
end
task :default => :test

View File

@ -1,3 +1,13 @@
require 'simplecov'
if ENV["COVERAGE"]
SimpleCov.start do
add_filter '/gems/'
add_filter '/test/'
add_filter '/spec/'
end
end
require 'rubygems'
require 'bundler'
begin

View File

@ -1,3 +1,13 @@
require 'simplecov'
if ENV["COVERAGE"]
SimpleCov.start do
add_filter '/gems/'
add_filter '/test/'
add_filter '/spec/'
end
end
require 'rubygems'
require 'bundler'
begin