-
Notifications
You must be signed in to change notification settings - Fork 275
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
Add support for custom Throw matchers #1348
Comments
Interesting. @drupol implemented something similar that uses during in https://github.com/loophp/phpspec-time |
Hmmm… interesting. I've had a quick look, but it looks like that library is using the simple @drupol are you familiar with this issue? |
Hi there,
This is indeed the purpose of phpspec-time, just to measure time, nothing else nothing more. Of course, it's pretty new and it might be incomplete, I guess there are ways to improve it for sure. |
OK, so to be able to catch exceptions in custom matchers using the during{Method}() type calls would be a useful addition then, by the sound of it. |
I think yes :-) |
Currently I don't believe it's possible to add customer Throw matchers that support the
during{MethodName}}()
type trigger method, since the current code tests whether the method called isshould[Not]Throw()
(or 'Trigger').I'm hoping to be able to submit a PR for this shortly that would update the ExpectationFactory to allow for customer matcher that started with 'should[Not]Throw' e.g.
should[Not]Throw{Whatever}()
(or Trigger) to generatePositiveThrow
|NegativeThrow
|PositiveTrigger
|NegativeTrigger
expectations, rather that the defaultPositive
|Negative
one.The text was updated successfully, but these errors were encountered: