1
0

Merge pull request from Applicat/replacing-rcov-by-simplecov

Switch from rcov to simplecov
This commit is contained in:
Gregory Eremin 2012-04-14 21:43:39 -07:00
commit f5b9f2e120
5 changed files with 37 additions and 6 deletions

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

@ -69,6 +69,7 @@ MusicBrainz::Track
* Start a feature/bugfix branch * Start a feature/bugfix branch
* Commit and push until you are happy with your contribution * 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. * 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. * 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 === Copyright

@ -32,12 +32,21 @@ Rake::TestTask.new(:test) do |test|
test.verbose = true test.verbose = true
end end
require 'rcov/rcovtask' require 'rspec/core/rake_task'
Rcov::RcovTask.new do |test| RSpec::Core::RakeTask.new(:spec) do |test|
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true 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 end
task :default => :test task :default => :test

@ -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 'rubygems'
require 'bundler' require 'bundler'
begin begin

@ -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 'rubygems'
require 'bundler' require 'bundler'
begin begin