-
Notifications
You must be signed in to change notification settings - Fork 82
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
[enhancement] Better display of errors. #261
Comments
I think there should be 3 colors: But this can be easily expressed with text interface:
|
Hi Machiaweliczny! Also keep in mind, sometimes it is not appropriate to color. For example, if the output is being written to a file, then the coloring would just add nonsense characters to the output. So you should check if the output is tty before coloring. |
@egonSchiele is this still relevant? Was looking over issues in the repo to see if there was another ticket about errors. Dunno about coloring in OP, would just love for the error message to tell me 'this key in the hash did not match the contract'. Have never contributed but would love to take a stab at this one as it would save me a lot of time debugging. |
First thanks for developing great library, but I would like to propose enhancement.
When testing this gem for complex params hashes I found that
ParamContractError
is almost unreadable. I mean structure of error is neat, but what is displayed inExpected:
is hardly readable IMO. AlsoActual:
would be nice with some coloring or addingErrors:
as I propose below.Expected:
shows inspected ruby structures instead of how I wrote assertion. Totaly unreadable - I just need to check where type was defined and read it in editor to compare.I propose also adding output coloring for
Actual:
- so coloring Red, or at least writing "INCORRECT" where you make mistake in recursive type.Example:
I would appreciate feedback about my proposal and tips how this could be implemented.
The text was updated successfully, but these errors were encountered: