Use Ginkgo with Gomega for specs in Go
If you are someone who favors spec-style testing, you may enjoy Ginkgo for describing your code and Gomega for make assertions about it. They are written by the same author and they play nicely both with each other and with Go's built in testing framework (you can do go test
to run the tests).
var _ = Describe('Fooing', func() { // Ginkgo
Context('When bar', func() { // Ginkgo
BeforeEach(func() { // Ginkgo
...
})
It('Should foobar!', func() { // Ginkgo
Expect(...).To(Equal(...)) // Gomega
})
})
Written by Keith Pinson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Specs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#