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

Factorize common DynamicPredicate base. #1197

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

marcandre
Copy link
Contributor

@marcandre marcandre commented Jun 18, 2020

The has_... and be_... dynamic predicate matchers have a lot in common.

This PR refactors both in terms of a common base class.

Output is kept the same temporarily

Precursor to #1195

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.

Looks good.
Travis is actually green (slow to report?)

lib/rspec/matchers/built_in/has.rb Show resolved Hide resolved
@JonRowe JonRowe changed the base branch from master to main August 2, 2020 02:05
Output is kept the same temporarily
@marcandre
Copy link
Contributor Author

Rebased, just to be sure.

@JonRowe could this be merged please? Two subsequent PRs are waiting on this.

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.

Sorry for the delay, after having had the time to finally give this a proper review, I have two questions.

Comment on lines +89 to +91
def predicate_method_name
predicate
end
Copy link
Member

@JonRowe JonRowe Aug 27, 2020

Choose a reason for hiding this comment

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

I feel like this should be in the Has class as this implementation is only used there? (I've checked the other PR so I think thats the case?)

Copy link
Member

@JonRowe JonRowe Aug 27, 2020

Choose a reason for hiding this comment

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

Ah actually, I see, its not used elsewhere in has, ignore this comment. Commented on the wrong comment.

lib/rspec/matchers/built_in/has.rb Show resolved Hide resolved
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.

Answered my own question and the remaining one is not a blocker.

@JonRowe JonRowe merged commit 8c68e05 into rspec:main Aug 27, 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.

3 participants