Skip to content

Commit

Permalink
Rakefile with tasks to spec and check coverage percentage. Default ta…
Browse files Browse the repository at this point in the history
…sk does both
  • Loading branch information
foca committed Jul 10, 2008
1 parent cac5fa0 commit 22b78bd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
log/*.log
config/config.yml
coverage
32 changes: 32 additions & 0 deletions Rakefile
@@ -0,0 +1,32 @@
require File.dirname(__FILE__) + "/lib/integrity"
require 'spec/rake/spectask'
require 'spec/rake/verify_rcov'

task :default => ["spec:coverage", "spec:coverage:verify"]

# shared options between the spec and the spec:coverage tasks
shared_spec_opts = lambda do |t|
t.spec_opts = ["--color", "--format", "specdoc"]
t.spec_files = Dir['spec/**/*_spec.rb'].sort
t.libs = ['lib']
end

Spec::Rake::SpecTask.new(:spec) do |t|
shared_spec_opts[t]
t.rcov = false
end

namespace :spec do
Spec::Rake::SpecTask.new(:coverage) do |t|
shared_spec_opts[t]
t.rcov = true
t.rcov_opts = ['--exclude-only', '".*"', '--include-file', '^lib']
end

namespace :coverage do
RCov::VerifyTask.new(:verify) do |t|
t.threshold = 100
t.index_html = "coverage" / 'index.html'
end
end
end

0 comments on commit 22b78bd

Please sign in to comment.