Created
December 24, 2011 20:44
-
-
Save CampingScorpion/1518307 to your computer and use it in GitHub Desktop.
nested fact descriptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(facts "about mathematics" | |
(fact "addition is commutative" | |
(+ 1 2) => 3 | |
(+ 2 1) => 4) ;; FAIL | |
(fact "multiplication is commutative" | |
(* 2 5) => 10 | |
(* 5 2) => 11)) ;; FAIL | |
;; These would report as: | |
;; FAIL: "about mathematics, addition is commutative" at (core.clj:995) | |
;; ... | |
;; FAIL: "about mathematics, multiplication is commutative" at (core.clj:999) | |
;; ... |
BTW, is midje setup to add different formatters (for reports)? It used to ride on top of clojure.test
but with lein-midje
I suspect it now has its own reporting functionality. Anyways, the reason why I bring it up is because rspec has a number of formatters and one of them the "nested" formatter which is really nice for tests like this. (It basically prints the tests out in similar intentation as they appear in the file.)
Hi Ben,
Would you mind drawing up a gist of the precise syntax and resulting report
output that you would ideally like to see?
…On Dec 25, 2011 10:40 PM, "Ben Mabey" < ***@***.***> wrote:
Looking good... this would fit well into my current use of midje. Right
now I've been doing the same thining, more or less, but without explicit
support from midje. How hard would it be to allow for docstrings in the
`provided` (and maybe background) forms as well? At times I find myself
doing things like `(fact ... (provided ; that blah blah errors out ...))`.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1518307
Currently no way to configure formatters. But sounds very doable. I'd
love to see an issue on github, showing exactly how it might work, ... how
do you configure which format? How does each format lool, etc etc etc
…On Dec 25, 2011 10:54 PM, "Ben Mabey" < ***@***.***> wrote:
BTW, is midje setup to add different formatters (for reports)? It used to
ride on top of `clojure.test` but with `lein-midje` I suspect it now has
its own reporting functionality. Anyways, the reason why I bring it up is
because rspec has a number of formatters and one of them the "nested"
formatter which is really nice for tests like this. (It basically prints
the tests out in similar intentation as they appear in the file.)
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1518307
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looking good... this would fit well into my current use of midje. Right now I've been doing the same thining, more or less, but without explicit support from midje. How hard would it be to allow for docstrings in the
provided
(and maybe background) forms as well? At times I find myself doing things like(fact ... (provided ; that blah blah errors out ...))
.