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

Cleanup matcher_execution_context. #485

Merged
merged 3 commits into from
Mar 2, 2014
Merged

Conversation

myronmarston
Copy link
Member

  • The external @matcher_execution_context (from self
    at the point the matcher method was called) was odd,
    and turns out never to have been needed. It was
    introduced in abba439
    but wasn't actually needed there (as the spec added
    in that commit passed when I tried removing it).
  • Given that it must be set (as respond_to? assumes
    it has been set), it was odd to have an extra
    attribute that gets set after instantiation.
    Far better to make it a constructor arg.
  • No need to expose it as public method.

This needs a 2.99 PR to deprecate the attribute before being merged.

@myronmarston
Copy link
Member Author

OK, I found a few more things to remove to reduce the API surface area. Anyone want to review this?

/cc @xaviershay @JonRowe @soulcutter

* The external @matcher_execution_context (from `self`
  at the point the matcher method was called) was odd,
  and turns out never to have been needed.  It was
  introduced in abba439
  but wasn't actually needed there (as the spec added
  in that commit passed when I tried removing it).
* Given that it must be set (as `respond_to?` assumes
  it has been set), it was odd to have an extra
  attribute that gets set after instantiation.
  Far better to make it a constructor arg.
* No need to expose it as public method.
It's nearly identical to `to_sentence`.
It's unnecessary and has some odd coupling, where it
assumes the including class has an `expected` attribute.

I prefer the simplicity of `to_sentence expected`.
@JonRowe
Copy link
Member

JonRowe commented Mar 2, 2014

LGTM

myronmarston added a commit that referenced this pull request Mar 2, 2014
Cleanup matcher_execution_context.
@myronmarston myronmarston merged commit 7b27fe0 into master Mar 2, 2014
@myronmarston myronmarston deleted the remove-unneeded-ivar branch March 2, 2014 06:13
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.

2 participants