Updated test:coverage rake task to use simplecov
This commit is contained in:
parent
af6dad2a6c
commit
138a7be690
|
@ -7,3 +7,4 @@
|
|||
/pkg
|
||||
/doc/api
|
||||
/Gemfile.lock
|
||||
/coverage
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -54,6 +54,7 @@ if RUBY_ENGINE == "ruby"
|
|||
gem 'sass'
|
||||
gem 'reel-rack'
|
||||
gem 'celluloid', '~> 0.16.0'
|
||||
gem 'simplecov', require: false
|
||||
end
|
||||
|
||||
if RUBY_ENGINE == "rbx"
|
||||
|
|
3
Rakefile
3
Rakefile
|
@ -55,7 +55,8 @@ namespace :test do
|
|||
desc 'Measures test coverage'
|
||||
task :coverage do
|
||||
rm_f "coverage"
|
||||
sh "rcov -Ilib test/*_test.rb"
|
||||
ENV['COVERAGE'] = '1'
|
||||
Rake::Task['test'].invoke
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
if ENV['COVERAGE']
|
||||
require 'simplecov'
|
||||
SimpleCov.start do
|
||||
add_filter '/test/'
|
||||
add_group 'sinatra-contrib', 'sinatra-contrib'
|
||||
add_group 'rack-protection', 'rack-protection'
|
||||
end
|
||||
end
|
||||
|
||||
ENV['APP_ENV'] = 'test'
|
||||
Encoding.default_external = "UTF-8" if defined? Encoding
|
||||
|
||||
|
|
Loading…
Reference in New Issue