a minimalist's unit testing framework
This project is maintained by seancorfield and jaycfields
adding signal, removing noise
;; expect a k/v pair in a map. (expect {:foo 1} (in {:foo 1 :cat 4})) ;; expect a key in a set (expect :foo (in #{:foo :bar})) ;; expect a val in a list (expect :foo (in [:foo :bar]))As you would expect, running these expectations results in 3 passing tests.
jfields$ lein expectations Ran 3 tests containing 3 assertions in 8 msecs 0 failures, 0 errors.As usual, I'll show the failures as well.
;; expect a k/v pair in a map. (expect {:foo 2} (in {:foo 1 :cat 4})) ;; expect a key in a set (expect :baz (in #{:foo :bar})) ;; expect a val in a list (expect :baz (in [:foo :bar])) jfields$ lein expectations failure in (core.clj:18) : sample.test.core (expect {:foo 2} (in {:foo 1, :cat 4})) expected: {:foo 2} in: {:foo 1, :cat 4} :foo expected: 2 was: 1 failure in (core.clj:21) : sample.test.core (expect :baz (in #{:foo :bar})) key :baz not found in #{:foo :bar} failure in (core.clj:24) : sample.test.core (expect :baz (in [:foo :bar])) value :baz not found in [:foo :bar]expectations does it's best to provide you with any additional info that might be helpful. In the case of the vector and the set there's not much else that can be said; however, the map failure gives you additional information that can be used to track down the issue.