This looks pretty cool! One thing I wonder, though, why am I seeing all these \n values rather than actual newlines in the "actual" value, which would make the output so much easier to read? Is there any way to configure or use it differently that would avoid this issue? (This is with lein test right after adding the dependency to my project.clj and changing one test to use matcha). Also, the "expected" message looks a little broken, should it not instead say something like expected: "a map with entry :status that equals 201"? (there is no word between "that" and "201"):
FAIL in (starting-and-stopping-production-server-works-as-expected) (httpkit_test.clj:17) start-production-server causes HttpKit and Hazelcast to start expected: "a map with entry :status that 201" actual: "a map with 200\n <class java.lang.Integer>\n diff:\n +: 201\n\n -: 200\n at key :status (was {:orig-content-encoding nil, :trace-redirects [\"http://localhost:12081/idp/status\"], :request-time 355, :status 200, :headers {\"Date\" \"Tue, 26 May 2015 21:36:11 GMT\", \"Server\" \"http-kit\", \"Content-Length\" \"319\", \"Content-Type\" \"application/json\"}, :body \"{\\n \\\"status\\\" : \\\"up\\\",\\n \\\"database\\\" : \\\"READ FAILED\\\",\\n \\\"build\\\" : \\\"DEV\\\",\\n \\\"time\\\" : \\\"2015-05-26T21:36:11Z\\\",\\n \\\"loadAverage\\\" : 1.82666015625,\\n \\\"heap\\\" : {\\n \\\"committed\\\" : 476053504,\\n \\\"max\\\" : 3817865216,\\n \\\"used\\\" : 277027488\\n },\\n \\\"nonHeap\\\" : {\\n \\\"committed\\\" : 75104256,\\n \\\"max\\\" : -1,\\n \\\"used\\\" : 71632504\\n }\\n}\"})" On Monday, May 25, 2015 at 3:27:13 PM UTC-5, tcrayford wrote: > > Matcha lets you write flexible, composable test assertions with human > friendly error messages. It's modeled after the excellent Java Hamcrest > library. > > As a quick example, you might build up a matcher that says "this map has 5 > elements, and the :foo key must be greater than 10" like so: > > ``` > (require '[matcha :as m]) > > (deftest my-map-test > (m/is (m/and (m/has-entry-that :foo (m/< 10)) (m/has-count 5)) > my-map)) > ``` > > If that ever returns false, you'll get an *excellently* readable error > message, detailing exactly why it failed. > > Matcha is completely test framework independent, though it does ship with > clojure.test support out of the box. Wiring it up to your test framework of > choice should take only a few minutes. > > Read more examples here > <http://yellerapp.com/posts/2015-25-05-matcha.html>, grab the code on > github <https://github.com/yeller/matcha> or checkout the api docs > <http://yeller.github.io/matcha/doc/matcha.html>. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.