t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--require', 'rubygems', '--color', '--format', 'specdoc']
if RCOV_ENABLED
+ if `which rcov`.strip == ""
+ STDERR.puts(
+ "Please install rcov and ensure that its binary is in the PATH:"
+ )
+ STDERR.puts("sudo gem install rcov")
+ exit(1)
+ end
t.rcov = true
else
t.rcov = false
end
t.rcov_opts = [
+ '--exclude', 'lib\\/compat',
'--exclude', 'spec',
+ '--exclude', '\\.rvm\\/gems',
'--exclude', '1\\.8\\/gems',
- '--exclude', '1\\.9\\/gems'
+ '--exclude', '1\\.9\\/gems',
+ '--exclude', '\\.rvm',
+ '--exclude', '\\/Library\\/Ruby',
]
end
task :verify => :rcov
end
- desc "Generate HTML Specdocs for all specs"
+ desc 'Generate HTML Specdocs for all specs'
Spec::Rake::SpecTask.new(:specdoc) do |t|
specdoc_path = File.expand_path(
File.join(File.dirname(__FILE__), '../specdoc/'))
output_file = File.join(specdoc_path, 'index.html')
t.spec_files = FileList['spec/**/*_spec.rb']
- t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
+ t.spec_opts = ['--format', "\"html:#{output_file}\"", '--diff']
t.fail_on_error = false
end
namespace :rcov do
- desc "Browse the code coverage report."
- task :browse => "spec:rcov" do
- require "launchy"
- Launchy::Browser.run("coverage/index.html")
+ desc 'Browse the code coverage report.'
+ task :browse => 'spec:rcov' do
+ require 'launchy'
+ Launchy::Browser.run('coverage/index.html')
end
end
end
if RCOV_ENABLED
- desc "Alias to spec:verify"
- task "spec" => "spec:verify"
+ desc 'Alias to spec:verify'
+ task 'spec' => 'spec:verify'
else
- desc "Alias to spec:all"
- task "spec" => "spec:all"
+ desc 'Alias to spec:all'
+ task 'spec' => 'spec:all'
end
-task "clobber" => ["spec:clobber_rcov"]
+task 'clobber' => ['spec:clobber_rcov']