Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Fix support for dynamic matchers #1295

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

pirj
Copy link
Member

@pirj pirj commented Mar 5, 2021

See rspec/rspec-collection_matchers#48

If a matcher supports dynamic arbitrary methods called on it, e.g. have_at_least(100).bucks, it would also consider a supports_value_expectations? call as a dynamic part.

Instead of calling supports_*? methods on a matcher, explicitly check if it responds to it.

Symmetrical change for main that suffers when rspec-rails 4.1.0.pre is used and rspec-expectations 3.11.0.pre is at #1294

See rspec/rspec-collection_matchers#48

If a matcher supports dynamic arbitrary methods called on it, e.g.
`have_at_least(100).bucks`, it would also consider a
`supports_value_expectations?` call as a dynamic part.

Instead of calling `supports_*?` methods on a matcher, explicitly
check if it responds to it.
@pirj pirj self-assigned this Mar 5, 2021
@pirj pirj added this to the 4.0 milestone Mar 5, 2021
@pirj pirj requested a review from JonRowe March 5, 2021 19:27
@pirj
Copy link
Member Author

pirj commented Mar 5, 2021

Pretty weird, several builds failed with

Fetching gem metadata from https://rubygems.org/....
Retrying dependency api due to error (2/4): Bundler::HTTPError Net::HTTPBadGateway: I/O error

and

Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError bad response Gateway Error 502 (https://rubygems.org/gems/parallel-1.20.1.gem)

while https://status.rubygems.org/ reports no incidents. Re-running.
PS didn't help, some jobs still fail.

Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

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

A shame but sure 😂

@pirj pirj merged commit 33f177c into 4-0-dev Mar 5, 2021
@pirj pirj deleted the fix-support-for-dynamic-matchers-4-0-dev branch March 5, 2021 22:11
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 19, 2021
…rspec/fix-support-for-dynamic-matchers-4-0-dev

Fix support for dynamic matchers

---
This commit was imported from rspec/rspec-expectations@33f177c.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants