Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

New Rspec tasks

  • Loading branch information...
commit fadf0802d4e5fa47a8b42cb2b923bd106bfd7fea 1 parent daa577a
Joseph Wilk authored
Showing with 12 additions and 34 deletions.
  1. +1 −3 Rakefile
  2. +11 −31 lib/tasks/rspec.rake
4 Rakefile
View
@@ -1,3 +1 @@
-Dir['lib/tasks/**/*.rake'].each { |rake| load rake }
-
-task :default => [:spec]
+Dir['lib/tasks/**/*.rake'].each { |rake| load rake }
42 lib/tasks/rspec.rake
View
@@ -1,33 +1,13 @@
-begin
- require 'spec'
-rescue LoadError
- require 'rubygems'
- require 'rspec'
-end
-begin
- require 'rspec/rake/spectask'
- require 'rspec/rake/verify_rcov'
-rescue LoadError
- puts <<-EOS
-To use rspec for testing you must install rspec gem:
- gem install rspec
-EOS
- exit(0)
-end
+require 'rspec/core/rake_task'
-desc "Run the specs under spec/models"
-Spec::Rake::SpecTask.new do |t|
- t.spec_opts = ['--options', "spec/spec.opts"]
- t.spec_files = FileList['spec/**/*_spec.rb']
-
- unless ENV['NO_RCOV']
- t.rcov = true
- t.rcov_dir = 'coverage'
- t.rcov_opts = ['--exclude', '_helper\.rb,_spec\.rb,spec\/boss,\/var\/lib\/gems,\/Library\/Ruby,\.autotest']
- end
-end
+desc 'Default: run specs.'
+task :default => :spec
-RCov::VerifyTask.new(:verify_rcov => :spec) do |t|
- t.threshold = 99.7 # Make sure you have rcov 0.9 or higher!
- t.index_html = 'coverage/index.html'
-end
+desc "Run specs"
+RSpec::Core::RakeTask.new
+
+desc "Generate code coverage"
+RSpec::Core::RakeTask.new(:coverage) do |t|
+ t.rcov = true
+ t.rcov_opts = ['--exclude', 'spec']
+end
Please sign in to comment.
Something went wrong with that request. Please try again.