Skip to content
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

Add --exclude_pattern option to configuration #1651

Closed
wants to merge 1 commit into from
Closed

Add --exclude_pattern option to configuration #1651

wants to merge 1 commit into from

Conversation

jmondo
Copy link
Contributor

@jmondo jmondo commented Jul 28, 2014

Resolves #1626. It allows passing --exclude_pattern to rspec on the command line.

Afaik we still can't use the power of rake tasks. This is because the rake task still uses FileList to include files. And once files are included, they can't be changed by passing --pattern or --exclude-pattern (there is a warning about this when you try). Fortunately, once #1589 is merged, it will be possible to pass --exclude-pattern within rspec_opts in the rake task config. This is because the rake task's pattern option will use --pattern which can be combined with --exclude-pattern for a one-two punch.

@myronmarston Let me know how this looks! Sorry it took so long.

When I run `rspec`
Then the output should contain "3 examples, 0 failures"

Scenario: The `--exclude-pattern` flag makes RSpec first match the default pattern, then skip files matching the specified exclude pattern
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording on this ("...makes RSpec first match the default pattern...") makes it sound like --exclude-pattern can't be combined with --pattern. If that's true, we should find a way to make them work together. If it's not true, we should find a better wording for this :).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you're right. They do work together. I'll work on that wording.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, maybe we can add a scenario showing them working together?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@myronmarston
Copy link
Member

BTW, in my review of #1589 I found some bugs in the --pattern option. #1652 has fixes. I think your new --exclude-pattern is prone to the same bugs so it would be good to fix the same issues for your option as part of this PR.

@myronmarston
Copy link
Member

I merged #1653 (which was basically #1589 rebased and fixed up) so can you add --exclude-pattern to the rake task as well?

@myronmarston
Copy link
Member

BTW, if there reaches a point where you don't have time or desire to continue working on this, let us know and we'll be happy to pick it up. We like to let contributors finish there PRs when they are able, though :).

@jmondo
Copy link
Contributor Author

jmondo commented Jul 31, 2014

Good to know. I'm planning on finishing it! Let me know if I need to hurry up.

@jmondo
Copy link
Contributor Author

jmondo commented Jul 31, 2014

Actually feel free to make the changes required to support those other two merges. Let me know if there's anything I should do with my feature after that.

@myronmarston
Copy link
Member

OK. I've got a couple other PRs on my list to tackle first, but I'll add yours to my list. In the meantime, if you want to take this further, feel free :).

@myronmarston
Copy link
Member

I'm going to pick this up in the next couple days and get it ready to merge.

myronmarston added a commit that referenced this pull request Aug 20, 2014
@myronmarston
Copy link
Member

Closing in favor of #1671.

MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude pattern for rspec runner
3 participants