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

fix(#3793): Fix Expect #3795

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

asmirnov-backend
Copy link

Ref: #3793

Now Expect is "fail fast" and the error message is only for one fail

@asmirnov-backend asmirnov-backend marked this pull request as draft January 8, 2025 17:24
*
* @since 0.51
*/
class ExpectFailureInMust extends ExFailure {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asmirnov-backend maybe it's better to make them nested classes, inside Expect?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for comment!
Unfortunately, the Expect<T> class can not contain nested exceptions, because Expect<T> is a generic class.
image

Possible solutions:

  1. Leave exceptions in separate classes
  2. Remove generic from Expect and make it works only with Phi
  3. Use static (But static is bad👎, I do not know is it ok to use it here). private static class ExpectFailureInThat extends ExFailure

@yegor256 Which solution do you want to choose?

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