-
Notifications
You must be signed in to change notification settings - Fork 128
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
Failed prerequisites with wrong args is not printing expected args #439
Comments
Hello, Can you post the fact that lead to this output? Also the version of midje you are using / try using the latest (stable) version if you aren't already. When I run a test like the following, I get the value expected: (use 'midje.repl)
(unfinished d)
(defn f [] (d 1))
(fact (f) => 2 (provided (d 2) => 2))
FAIL at (form-init6601585616923364043.clj:1)
You never said #'d would be called with these arguments:
[1]
FAIL at (form-init6601585616923364043.clj:1)
These calls were not made the right number of times:
(d 2) [expected at least once, actually never called]
FAIL at (form-init6601585616923364043.clj:1)
Expected:
2
Actual:
"`d` returned this string because it was called with an unexpected argument" Cheers! |
Hi @phillipM,
And I think it would be more useful to say:
|
This info is currently available in this part of the output
But it isn't the most readable. Maybe it would be better to reorganize
to be grouped
I like this idea, I will keep it in mind as I work on the failure reporting code (something I have been mucking around in lately). That said, I don't see it being a super straightforward update, so don't hold your breath for it. Also to keep in mind with this change is that you can add more than one fake for (defn f [] (do (d -2) (d -4)))
(fact
(f) => 2
(provided
(d (as-checker pos?)) => 2
(d (as-checker odd?)) => 3)) (see here for as-checker docs) |
As described in https://github.com/marick/Midje/wiki/Describing-one-checkable%27s-prerequisites, in the case of a failure non equal arguments the, following will print:
Would be nice to print also the expected value, because in the case of equality assertions on some data structures would save some time in figuring out which parts didn't match.
The text was updated successfully, but these errors were encountered: