Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add spec and spec:rcov rake tasks

  • Loading branch information...
commit 877a054b7209e903de7a0f86db4e1926c31b984d 1 parent ea07213
@mocoso authored
Showing with 37 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +36 −0 Rakefile
View
1  .gitignore
@@ -0,0 +1 @@
+coverage/
View
36 Rakefile
@@ -0,0 +1,36 @@
+# RSpec support
+begin
+ require 'spec'
+rescue LoadError
+ require 'rubygems'
+ require 'spec'
+end
+begin
+ require 'spec/rake/spectask'
+rescue LoadError
+ puts <<-EOS
+ To use rspec for testing you must install rspec gem:
+ gem install rspec
+ EOS
+ exit(0)
+end
+
+spec_common = Proc.new do |t|
+ t.spec_files = FileList['Support/spec/**/*/*_spec.rb']
+end
+
+task :default => :spec
+
+desc "Run all specs in spec directory"
+Spec::Rake::SpecTask.new(:spec) do |t|
+ spec_common.call(t)
+end
+
+namespace :spec do
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:rcov) do |t|
+ spec_common.call(t)
+ t.rcov = true
+ t.rcov_opts = ['-x', 'Support/spec/', '-T']
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.