Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add spec and rcov_spec tasks to the Rakefile, but only if you have rs…

…pec installed
  • Loading branch information...
commit bca9702537151fd74c368c91e24288179a48f098 1 parent d2c7cc8
@kballard kballard authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 Rakefile
View
19 Rakefile
@@ -17,3 +17,22 @@ rescue LoadError => boom
puts "You are missing a dependency required for meta-operations on this gem."
puts "#{boom.to_s.capitalize}."
end
+
+# add spec tasks, if you have rspec installed
+begin
+ require 'spec/rake/spectask'
+
+ desc "Run all specs"
+ Spec::Rake::SpecTask.new("spec") do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = ['--color']
+ end
+
+ desc "Run all specs with RCov"
+ Spec::Rake::SpecTask.new("rcov_spec") do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = ['--color']
+ t.rcov = true
+ t.rcov_opts = ['--exclude', 'spec']
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.