New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible regression in pattern configuration for 2.14 #993

Closed
iamvery opened this Issue Jul 15, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@iamvery
Contributor

iamvery commented Jul 15, 2013

I have managed to narrow an issue with turnip down to what may be a regression in RSpec 2.14.

It seems that specifying additional patterns to match files on does that load specs in those files under 2.14. This is how turnip managed to load .feature files for their gherkin features.

I dug into RSpec's source a bit and observed that files_to_run appears to get set earlier under 2.14 and is not updated when the pattern is changed. I'm not completely sure what that means and was not able to narrow down the change.


I did however come up with a simplified example and steps to reproduce:

bundle install # make sure 2.13 is installed
bundle exec rspec
  • Observe that two specs are run (the one in a_spec.rb and a_test.rb)
  • Check out commit tag using RSpec 2.14 bundle git checkout rspec-2.14
  • Run the specs under 2.14
bundle install # make sure 2.14 is installed
bundle exec rspec
  • Observe that only one spec is run (the one in a_spec.rb)

Hopefully these instructions are clear. I wasn't 💯 sure of the best way to ensure my example could be run with different versions of RSpec.

@JonRowe

This comment has been minimized.

Member

JonRowe commented Jul 15, 2013

FYI --pattern 'pattern' still works wether from the cmd line or from .rspec, I'll look into why the configuration option isn't working.

@iamvery

This comment has been minimized.

Contributor

iamvery commented Jul 15, 2013

Good call, so it's worth nothing that a temporary fix would be to add something like -P **/*_spec.rb,**/*.feature to your .rspec file. This will pick up and run your turnip features.

@JonRowe

This comment has been minimized.

Member

JonRowe commented Jul 15, 2013

--pattern '**/*_{spec.rb,feature,test.rb}' etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment