Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (45 sloc) 1.71 KB
namespace :rcov do
# Runs specs, runs rcov and textual summary
Spec::Rake::SpecTask.new(:bw) do |t|
t.spec_files = Dir['spec/**/*_spec.rb'].sort
t.libs = ['lib', 'server/lib' ]
t.rcov = true
# t.rcov_opts = ['--exclude-only', '".*"', '--include-file', '^app,^lib']
t.rcov_opts = ['--text-summary', '--exclude-only', '"spec\/,^\/"']
t.rcov_dir = :meta / :coverage
end
# Runs specs, runs rcov, with color and textual summary
Spec::Rake::SpecTask.new(:run) do |t|
t.spec_opts = ["--colour"]
t.spec_files = Dir['spec/**/*_spec.rb'].sort
t.libs = ['lib', 'server/lib' ]
t.rcov = true
# t.rcov_opts = ['--exclude-only', '".*"', '--include-file', '^app,^lib']
t.rcov_opts = ['--text-summary', '--exclude-only', '"spec\/,^\/"']
t.rcov_dir = :meta / :coverage
end
# Runs verbose specs, runs rcov, with color and textual summary
Spec::Rake::SpecTask.new(:verbose) do |t|
t.spec_opts = ["--format", "specdoc", "--colour"]
t.spec_files = Dir['spec/**/*_spec.rb'].sort
t.libs = ['lib', 'server/lib' ]
t.rcov = true
# t.rcov_opts = ['--exclude-only', '".*"', '--include-file', '^app,^lib']
t.rcov_opts = ['--text-summary', '--exclude-only', '"spec\/,^\/"']
t.rcov_dir = :meta / :coverage
end
# Verify coverage
RCov::VerifyTask.new(:verify) do |t|
t.threshold = StrokeDB::COVERAGE
t.index_html = :meta / :coverage / 'index.html'
t.require_exact_threshold = false
end
# Verify coverage, strictly
RCov::VerifyTask.new(:strict) do |t|
t.threshold = StrokeDB::COVERAGE
t.index_html = :meta / :coverage / 'index.html'
end
task :open do
system 'open ' + :meta / :coverage / 'index.html' if PLATFORM['darwin']
end
end