This repository was archived by the owner on Nov 30, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the start of a fix for #1280. So far I've only gotten as far as a test exposing the issue.
The "easy" fix for this is to reorder things so that the
files_to_run
are resolved beforerequires
are processed. However, that would break the fix @JonRowe put in place in 25d6b3a, which allowspattern
to be set in anRSpec.configure
block if you use a CLI option to require your spec helper.pattern
can affectfiles_to_run
so the change he made makes sense. I'm not sure what the best fix is. A few ideas:files_to_run
, rather than being assigned at a particular point in time, is lazily computed on first access. If the user setspattern
before accessingfiles_to_run
it would take the pattern into account but otherwise it wouldn't. This might require a large amount of refactoring.config.running_one_spec_file?
that is set to true if and only if a single file name has been passed at the command line. I think this can be computed apart from thepattern
so it could happen earlier.@JonRowe, what are your thoughts, since you've worked in this area before?
I'm interested in everyone's feedback, though.
/cc @xaviershay @alindeman @soulcutter @samphippen