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.
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 :)
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 underspec
). Yourmatching_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.