Skip to content

Commit

Permalink
Add appropriate Rake tasks for RSpec (ignore generated rcov report.)
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Chacon <[email protected]>
  • Loading branch information
bitbckt authored and schacon committed Dec 16, 2008
1 parent 29dfc3d commit e532686
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pkg
*~
report.html
16 changes: 16 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'rubygems'
Gem::manage_gems
require 'rake/gempackagetask'
require 'spec/rake/spectask'

spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
Expand All @@ -26,3 +27,18 @@ task :default => "pkg/#{spec.name}-#{spec.version}.gem" do
puts "generated latest version"
end

desc 'Run specs'
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ['--format', 'specdoc', '--colour', '--diff']
end

desc 'Generate coverage reports'
Spec::Rake::SpecTask.new('spec:coverage') do |t|
t.rcov = true
end

desc 'Generate a nice HTML report of spec results'
Spec::Rake::SpecTask.new('spec:report') do |t|
t.spec_opts = ['--format', 'html:report.html', '--diff']
end

0 comments on commit e532686

Please sign in to comment.