Fork me on GitHub
#announcements
<
2022-09-02
>
Cam Saul03:09:02

Hello everyone. I'd like to announce a brand new tiny library that fixes a personal pain point. https://github.com/camsaul/humane-are I've been using some version of this or another for a while now; I thought it was finally time to spin it out into a separate library, in case anyone else found it useful. I love clojure.test/are, but I've generally avoided it for two reasons: 1. Failing assertions give no indication as to which set of arguments failed if you're using anything that pretty prints test output, such as https://github.com/pjstadig/humane-test-output, https://github.com/clojure-emacs/cider, or https://github.com/weavejester/eftest 2. are lets you shoot yourself in the foot by writing expressions that include is or testing, and wraps them in another is without complaining Humane Are solves those problems. Try it out and let me know what you think!

🎉 4
1
👍 14
seancorfield04:09:54

This is cool. clojure.test can be pretty frustrating and quite limited. I will take this opportunity to promote Expectations:

seanc@Sean-win-11-laptop:~/clojure$ clj -Sdeps '{:deps {com.github.seancorfield/expectations {:mvn/version "RELEASE"}}}'
Downloading: com/github/seancorfield/expectations/maven-metadata.xml from clojars
Clojure 1.11.1
user=> (require '[expectations.clojure.test :refer :all])
nil
user=> (expect even? (from-each [n (range 20)] n))

FAIL in () (NO_SOURCE_FILE:1)
n

expected: (=? even? n)
  actual: (not (even? 1))

FAIL in () (NO_SOURCE_FILE:1)
n

expected: (=? even? n)
  actual: (not (even? 3))

FAIL in () (NO_SOURCE_FILE:1)
n

expected: (=? even? n)
  actual: (not (even? 5))
Completely clojure.test-compatible in terms of tooling but a lot more expressive.

👍 2
borkdude11:09:41

I've been avoiding are mostly in favor of doseq

☝️ 1
❤️ 1
borkdude11:09:52

Also, I find giant are blocks a pain when you want to isolate one case to work on in the REPL

Noah Bogart13:09:00

I wonder if this could be upstreamed.

slipset07:09:02

https://clojars.org/clj-commons/clj-yaml is released with a bump of snakeyaml to 1.31. This fixes https://github.com/advisories/GHSA-3mc7-4q67-w48m. Thanks to @tscrowley for the PR!

👍 4
gratitude 2