public
Rubygem
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
Added 'rake coverage' for an rcov report
rmm5t (author)
Tue Jul 01 07:06:29 -0700 2008
commit  e1a54268b0fd318b952889fef319e89164b9a4e7
tree    1df94db26c943b362f49360320c84223a48cd67f
parent  66be6bc125f7869ee41f0d2d49df8b95ba486cb6
...
1
2
 
...
1
2
3
0
@@ -1,2 +1,3 @@
0
 test/rails_root/log/*.log
0
 doc
0
+coverage
...
3
4
5
6
 
7
8
9
 
10
11
12
...
18
19
20
 
 
 
 
 
 
 
21
22
23
...
3
4
5
 
6
7
8
 
9
10
11
12
...
18
19
20
21
22
23
24
25
26
27
28
29
30
0
@@ -3,10 +3,10 @@ require 'rake/testtask'
0
 require 'rake/rdoctask'
0
 
0
 # Test::Unit::UI::VERBOSE
0
-
0
+test_files_pattern = 'test/{unit,functional,other}/**/*_test.rb'
0
 Rake::TestTask.new do |t|
0
   t.libs << 'lib'
0
- t.pattern = 'test/{unit,functional,other}/**/*_test.rb'
0
+ t.pattern = test_files_pattern
0
   t.verbose = false
0
 end
0
 
0
@@ -18,6 +18,13 @@ Rake::RDocTask.new { |rdoc|
0
   rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
0
 }
0
 
0
+desc "Run code-coverage analysis using rcov"
0
+task :coverage do
0
+ rm_rf "coverage"
0
+ files = Dir[test_files_pattern]
0
+ system "rcov --rails --sort coverage -Ilib #{files.join(' ')}"
0
+end
0
+
0
 desc 'Update documentation on website'
0
 task :sync_docs => 'rdoc' do
0
   `rsync -ave ssh doc/ dev@dev.thoughtbot.com:/home/dev/www/dev.thoughtbot.com/shoulda`

Comments

    No one has commented yet.