Rspec-core: rspec not running all specs in given folder

Created on 8 Apr 2015  ·  5Comments  ·  Source: rspec/rspec-core

I put my specs under spec/ folder.
When I run rspec spec/* it run all specs properly.
However when I run rspec spec/ (without asterisk) it skip one spec files in the directory.

Most helpful comment

RSpec is working as expected and documented in your repo. RSpec uses a glob pattern to find spec files. By default it is set to spec/**/*_spec.rb (e.g. _spec.rb files under spec). Your matching_engine_handle_edge_cases.rb file does not match that pattern and thus is not loaded by default.

You should rename that file to have a _spec.rb suffix, or configure RSpec to use a different pattern if you don't like the default pattern.

All 5 comments

Can you provide more details? What are the specific file names? Can you put together an example repo that shows the problem?

okay, so please get this repo: https://github.com/phuongnd08/rspec-error-reports

In this repo, after bundle, when you run rspec spec/* you can see the edge case spec being run. If you run rspec spec it won't be run.

I'm on a mac btw.

Was you able to reproduce the issue?

RSpec is working as expected and documented in your repo. RSpec uses a glob pattern to find spec files. By default it is set to spec/**/*_spec.rb (e.g. _spec.rb files under spec). Your matching_engine_handle_edge_cases.rb file does not match that pattern and thus is not loaded by default.

You should rename that file to have a _spec.rb suffix, or configure RSpec to use a different pattern if you don't like the default pattern.

Thanks, my bad :)

Was this page helpful?
0 / 5 - 0 ratings