-
-
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
Change matcher protocol #373
Conversation
BTW, one thing you'll notice I'm doing differently here: I'm adding deprecation warnings to 3.0 rather than breaking things in 3.0 and adding deprecations to 2.99. While it would be nice to make the breaking change in 3.0 and not keep some old cruft around, these API changes are very likely to affect some extension gems (such as shoulda). I don't want users blocked from upgrading to 3.0 because of extension gems they use relying on the old APIs -- thus, I thought it best to retain support for the old protocol in 3.x. We'll plan to drop it in 4.0. One thing that may surprise users is that they can get warning-free on 2.99, upgrade to 3.0, and then still get warnings. We'll need to make it clear that getting warning free on 2.99 means that their test suite should run on 3.0 w/o any failures, but it does not imply it will run w/o any deprecations. |
I've decided to do the |
- failure_message_for_should => failure_message - failure_message_for_should_not => failure_message_when_negated Given that we are moving away from `should`, it would be odd to keep them in these APIs.
I'll be adding a new one.
LGTM but I did find the block syntax you used for the matcher adapters a bit confusing at first... |
To what are you referring? I'm not seeing any blocks involved in the legacy matcher adapters... |
Ah, that. That's the positive/negative handler, not the matcher adapters (hence my confusion). Anyhow, take a look at ef10165 (and the contents of |
Sort of but I think merge this as is, and then I might have a go at refactoring it. |
Done. |
This is a first pass for #270. I'm pretty happy with it so far but there's still
RSpec::Matcher.last_should
to update. if this get s LGTM from another rspec core member I'll go ahead and merge w/o that; otherwise I'll add that to this PR.