Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capybara + RSpec, spec/features dir being ignored by the rspec . command?

I'm using the new Capybara DSL with rspec following the short guideline located here And the tests added to the spec/features directory run well alone, ie.

rails_project$ rspec spec/features/my_first_feature.rb

However the spec/features directory is totally ignored when I try to run the tests for the entire spec/ directory like this:

rails_project$ rspec .

There is no mention in the guide about how to include this directory (or other directory) to accomplish this inclusion that I desire. I really need this for continuous integration of my project.

Can anybody please tell me how to do it?

Thanks!

like image 507
jlstr Avatar asked Dec 04 '12 15:12

jlstr


1 Answers

You need to make sure all of your specs end in_spec.rb.

Change the filename to spec/features/my_first_feature_spec.rb

This is how I do it:

rspec spec

You may also want to use guard-rspec, which gives you better control.

like image 169
B Seven Avatar answered Sep 27 '22 18:09

B Seven