Skip to content

Instantly share code, notes, and snippets.

@adzap
Created June 24, 2010 05:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adzap/451044 to your computer and use it in GitHub Desktop.
Save adzap/451044 to your computer and use it in GitHub Desktop.
# Get your spec rake tasks working in RSpec 2.0
require 'rspec/core/rake_task'
desc 'Default: run specs.'
task :default => :spec
desc "Run specs"
RSpec::Core::RakeTask.new do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
# Put spec opts in a file named .rspec in root
end
desc "Generate code coverage"
RSpec::Core::RakeTask.new(:coverage) do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
t.rcov = true
t.rcov_opts = ['--exclude', 'spec']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment