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

Support block snippet extraction with aliased matchers #988

Merged

Conversation

yujinakayama
Copy link
Member

@yujinakayama yujinakayama commented May 4, 2017

Follow-up to #987.

The interface is not smart but we cannot pass matcher name to the constructor with the current matcher protocol.

... so that the matcher can know what name it was called.

The interface is not smart but we cannot pass matcher name to the
constructor with the current matcher protocol.
Copy link
Member

@myronmarston myronmarston left a comment

Choose a reason for hiding this comment

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

One concern.

if defined?(@matcher_name)
@matcher_name
else
self.class.matcher_name
Copy link
Member

Choose a reason for hiding this comment

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

Why does this fall back to the class method (and is there a matcher_name class method even defined?).

Copy link
Member Author

Choose a reason for hiding this comment

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

Because #matcher_name= is set only when aliased (i.e. @matcher_name is nil when using matchers with their original name)..

The class method is defined here.

@yujinakayama yujinakayama merged commit a72cb50 into master May 4, 2017
@yujinakayama yujinakayama deleted the support-block-snippet-extraction-with-aliased-matchers branch May 4, 2017 07:56
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.

None yet

2 participants