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

Fix include(/regexp/) when used without a count. #1485

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Sep 5, 2024

Fixes #1481 there was a bug where a regexp and a count contraint would work with the include matcher, but not a bare regexp e.g.

# worked
expect("astring").to include(/a/).once

# failed
expect("astring").to include(/a/)

This makes this consistent with the docs as working, in another version of RSpec we may look to deprecate this usage as it is not doing an include? call but using scan instead.

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Thanks!

@JonRowe JonRowe merged commit 981136e into main Sep 6, 2024
30 checks passed
@JonRowe JonRowe deleted the fix-regexp-include-without-count branch September 6, 2024 07:52
JonRowe added a commit that referenced this pull request Sep 6, 2024
JonRowe added a commit that referenced this pull request Sep 6, 2024
Fix `include(/regexp/)` when used without a count.
JonRowe added a commit that referenced this pull request Sep 6, 2024
@JonRowe
Copy link
Member Author

JonRowe commented Sep 7, 2024

Released in 3.13.3

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.

Behaviour of include against a String with a Regexp matcher "feels" inconsistent
2 participants