Merge pull request #2 from Applicat/replacing-rcov-by-simplecov
Switch from rcov to simplecov
This commit is contained in:
commit
f5b9f2e120
3
Gemfile
3
Gemfile
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
19
Rakefile
19
Rakefile
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue