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

Allow custom matchers to use built-in #match #194

Merged

Conversation

stevenharman
Copy link
Contributor

See Issue #188.

Addresses problem with dispatching the #match matcher from within a
custom matcher. (Wow... what a mouthful) See Issue rspec#188.
@myronmarston
Copy link
Member

Nice work! This looks like an appropriate fix.

I think it could benefit from some docs explaining the reason match_regex exists (e.g. as a work around when you're in a context that has another match method). Can you add that?

@stevenharman
Copy link
Contributor Author

Thanks.

I was thinking some explanation was due as well, but I'm not quite sure where to put it. Suggestions?

@myronmarston
Copy link
Member

Maybe here and in the cuke you modified?

@stevenharman
Copy link
Contributor Author

OK, I'll add some docs tomorrow - Big Nerd Ranch holiday party starts 🔜

@alindeman
Copy link
Contributor

This looks good to me now.

myronmarston added a commit that referenced this pull request Dec 7, 2012
…ith_match

Allow custom matchers to use built-in #match
@myronmarston myronmarston merged commit 7fe9ec4 into rspec:master Dec 7, 2012
@myronmarston
Copy link
Member

Thanks, @stevenharman!

eloyesp pushed a commit to eloyesp/rspec-expectations that referenced this pull request Nov 5, 2013
Rather than evaling the `define` block in the
context of the matcher instance, eval the `define`
block in the context of the matcher instance's
singleton class.

* Fixes rspec#272.
  `include` in `define` has a different meaning (module inclusion)
  than `include` in the `match` block (using the `include` matcher to
  match).
* Better solution than rspec#194
  for rspec#188. There's now
  a `match` class method and a `match` instance method.
* Completely avoids issues we had to use hacks to solve before:
  rspec#29,
  rspec#38,
  rspec@fc4b66d
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

3 participants