BDD in Go is made easier using the Ginkgo and Gomega
packages. Gomega specifically provides a collection of matchers for asserting
that results match expectations. When using these tools to test an API I was
developing I noticed some common patterns appearing around the assertion of
HTTP status codes. I created the
github.com/jcbwlkr/httpmatchers package to
simplify some of those patterns.
Since writing this I hame moved to just using the standard
testing library. I
still appreciate the value from
gomega and would use the library
again if I was working on a project using that testing framework.