Skip to content

Commit

Permalink
Added 'rake coverage' for an rcov report
Browse files Browse the repository at this point in the history
  • Loading branch information
rmm5t committed Jul 12, 2008
1 parent 66be6bc commit e1a5426
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test/rails_root/log/*.log
doc
coverage
11 changes: 9 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ require 'rake/testtask'
require 'rake/rdoctask'

# Test::Unit::UI::VERBOSE

test_files_pattern = 'test/{unit,functional,other}/**/*_test.rb'
Rake::TestTask.new do |t|
t.libs << 'lib'
t.pattern = 'test/{unit,functional,other}/**/*_test.rb'
t.pattern = test_files_pattern
t.verbose = false
end

Expand All @@ -18,6 +18,13 @@ Rake::RDocTask.new { |rdoc|
rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
}

desc "Run code-coverage analysis using rcov"
task :coverage do
rm_rf "coverage"
files = Dir[test_files_pattern]
system "rcov --rails --sort coverage -Ilib #{files.join(' ')}"
end

desc 'Update documentation on website'
task :sync_docs => 'rdoc' do
`rsync -ave ssh doc/ [email protected]:/home/dev/www/dev.thoughtbot.com/shoulda`
Expand Down

0 comments on commit e1a5426

Please sign in to comment.