Skip to content

Instantly share code, notes, and snippets.

@chikamichi
Created October 12, 2011 11:03
Show Gist options
  • Save chikamichi/1280927 to your computer and use it in GitHub Desktop.
Save chikamichi/1280927 to your computer and use it in GitHub Desktop.
How to add customs rspec tasks in Rails 3
# Our goal is to be able to run spec:bricks along spec, when
# using the 'rake spec' command.
# In lib/tasks/custom_specs.rake, add:
require 'rake/testtask'
require 'rspec/core/rake_task'
namespace :spec do
desc "Run bricks specs"
RSpec::Core::RakeTask.new('bricks') do |spec|
spec.pattern = 'storm-bricks/spec/**/*_spec.rb'
end
end
Rake::Task[:spec].enhance do
Rake::Task["spec:bricks"].invoke
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment