Skip to content

Instantly share code, notes, and snippets.

@maxime
Created December 14, 2008 18:07
Show Gist options
  • Save maxime/35743 to your computer and use it in GitHub Desktop.
Save maxime/35743 to your computer and use it in GitHub Desktop.
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
begin
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
t.rcov_opts << "--exclude 'config,spec,#{Gem::path.join(',')}'"
t.rcov_opts << '--text-summary'
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
rescue Exception
# rcov not installed
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment