A simple Go program that consumes the icanhazdadjoke API. Includes tests written in Ginkgo and Gomega.
git clone https://github.com/nitsas/icanhazdadjoke
cd icanhazdadjoke
go buildAssuming that you have built the program and named the result icanhazdadjoke (the default):
# Print a random joke:
$ icanhazdadjoke
Joke cxHYg3gFQf:
I got fired from the transmission factor, turns out I didn't put on enough shifts...
# Print a specific joke by id:
$ icanhazdadjoke EYoz51DtHtc
Joke EYoz51DtHtc:
What do computers and air conditioners have in common? They both become useless when you open windows.To execute the tests, you can run this from the root of the repo:
go test ./clientOr if you have ginkgo in your PATH:
ginkgo -r
# For more verbose output:
ginkgo -r -v