1 ### From http://svn.geekdaily.org/public/rails/plugins/generally_useful/tasks/coverage_via_rcov.rake
4 desc 'Measures test coverage'
8 rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib --html"
9 files = Dir.glob("test/**/*_test.rb").join(" ")
10 system("#{rcov} #{files}")
11 system("open coverage/index.html") if PLATFORM['darwin']
16 desc "Creates directory for test repositories"
18 FileUtils.mkdir_p Rails.root + '/tmp/test'
21 supported_scms = [:subversion, :cvs, :bazaar, :mercurial, :git, :darcs, :filesystem]
23 desc "Creates a test subversion repository"
24 task :subversion => :create_dir do
25 repo_path = "tmp/test/subversion_repository"
26 system "svnadmin create #{repo_path}"
27 system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}"
30 (supported_scms - [:subversion]).each do |scm|
31 desc "Creates a test #{scm} repository"
32 task scm => :create_dir do
33 system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test"
37 desc "Creates all test repositories"
38 task :all => supported_scms