Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added 'rake coverage' for an rcov report

  • Loading branch information...
commit e1a54268b0fd318b952889fef319e89164b9a4e7 1 parent 66be6bc
@rmm5t rmm5t authored
Showing with 10 additions and 2 deletions.
  1. +1 −0  .gitignore
  2. +9 −2 Rakefile
View
1  .gitignore
@@ -1,2 +1,3 @@
test/rails_root/log/*.log
doc
+coverage
View
11 Rakefile
@@ -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
@@ -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/ dev@dev.thoughtbot.com:/home/dev/www/dev.thoughtbot.com/shoulda`
Please sign in to comment.
Something went wrong with that request. Please try again.