1 require 'spec/rake/verify_rcov'
4 Spec::Rake::SpecTask.new(:rcov) do |t|
5 t.spec_files = FileList['spec/**/*_spec.rb']
6 t.spec_opts = ['--require', 'rubygems', '--color', '--format', 'specdoc']
8 if `which rcov`.strip == ""
9 STDERR.puts "Please install rcov:"
10 STDERR.puts "sudo gem install relevance-rcov"
19 '--exclude', '1\\.8\\/gems',
20 '--exclude', '1\\.9\\/gems'
24 Spec::Rake::SpecTask.new(:all) do |t|
25 t.spec_files = FileList['spec/**/*_spec.rb']
26 t.spec_opts = ['--require', 'rubygems', '--color', '--format', 'specdoc']
30 Spec::Rake::SpecTask.new(:fast) do |t|
31 t.spec_files = FileList['spec/**/*_spec.rb'].exclude(
32 'spec/**/*_slow_spec.rb'
34 t.spec_opts = ['--require', 'rubygems', '--color', '--format', 'specdoc']
39 RCov::VerifyTask.new(:verify) do |t|
41 t.index_html = 'coverage/index.html'
47 desc 'Generate HTML Specdocs for all specs'
48 Spec::Rake::SpecTask.new(:specdoc) do |t|
49 specdoc_path = File.expand_path(
50 File.join(File.dirname(__FILE__), '../specdoc/'))
51 Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
53 output_file = File.join(specdoc_path, 'index.html')
54 t.spec_files = FileList['spec/**/*_spec.rb']
55 t.spec_opts = ['--format', "\"html:#{output_file}\"", '--diff']
56 t.fail_on_error = false
60 desc 'Browse the code coverage report.'
61 task :browse => 'spec:rcov' do
63 Launchy::Browser.run('coverage/index.html')
69 desc 'Alias to spec:verify'
70 task 'spec' => 'spec:verify'
72 desc 'Alias to spec:all'
73 task 'spec' => 'spec:all'
76 task 'clobber' => ['spec:clobber_rcov']