-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
Allow custom matchers to use built-in #match #194
Conversation
Addresses problem with dispatching the #match matcher from within a custom matcher. (Wow... what a mouthful) See Issue rspec#188.
Nice work! This looks like an appropriate fix. I think it could benefit from some docs explaining the reason |
Thanks. I was thinking some explanation was due as well, but I'm not quite sure where to put it. Suggestions? |
Maybe here and in the cuke you modified? |
OK, I'll add some docs tomorrow - Big Nerd Ranch holiday party starts 🔜 |
This looks good to me now. |
…ith_match Allow custom matchers to use built-in #match
Thanks, @stevenharman! |
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
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/rspec-expectations#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/rspec-expectations#194 for rspec/rspec-expectations#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/rspec-expectations#29, rspec/rspec-expectations#38, rspec/rspec-expectations@8a3aa5e
See Issue #188.