spec_files in Rspec::Core::RakeTask #128

Closed
rodrigoflores opened this Issue Aug 27, 2010 · 2 comments

Projects

None yet

3 participants

@rodrigoflores

Hi

I'm trying to modify the rspec-rails rake task, to run all spec directories except a directory called acceptance that contains all steak acceptance tasks. In older rspec versions (http://rspec.info/documentation/tools/rake.html) there is a spec_files to specify that, but on the new rspec I don't see it anymore.

Is there a way that I can exclude a directory on rspec ?

@justinko

Rather than hacking or over-riding the default rspec-rails rake task (which runs all specs in any directory within "spec"), I would suggest using an exclusion filter. Example:

In acceptance/my_acceptance_spec.rb:

feature "Main page", :steak => true do ...

In your spec_helper.rb:

RSpec.configure do |config|
  config.filter_run_excluding :steak => true
end
@dchelimsky
RSpec member

Or you can use the pattern property of the rake task if you want:

namespace :spec do
  desc "runs everything bug steak"
  RSpec::Core::RakeTask.new(:veggie) do |t|
    t.pattern = "spec/{models,views,controllers,helpers}/**/*_spec.rb"
  end
end
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment