https://github.com/mindreframer/golang-testing-stuff
https://github.com/mindreframer/golang-testing-stuff
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mindreframer/golang-testing-stuff
- Owner: mindreframer
- Created: 2013-08-25T11:39:28.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-05T22:14:31.000Z (almost 12 years ago)
- Last Synced: 2024-12-27T05:07:42.462Z (over 1 year ago)
- Language: Go
- Size: 1.22 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
### A copy with slight modifications from https://github.com/shageman/gotestit.git
## Presentations:
- [Test-Patterns in Go, 2013.10](https://s3.amazonaws.com/cmdrkeene-talks/test-patterns-in-go.html)
*** GENERATED BY https://github.com/mindreframer/techwatcher (ruby _sh/pull golang-testing-stuff) ***
bmatsuo/go-spec:
Another interpretation of RSpec for Go (golang)
30 commits, last change: , 9 stars, 1 forks
cloudfoundry/gosteno:
74 commits, last change: , 8 stars, 5 forks
franela/goblin:
Minimal and Beautiful Go testing framework
114 commits, last change: , 118 stars, 7 forks
gophertown/looper:
Autotesting tool with readline support.
77 commits, last change: , 91 stars, 4 forks
onsi/ginkgo:
BDD Testing Framework for Go
258 commits, last change: , 308 stars, 18 forks
orfjackal/gospec:
Testing framework for Go. Allows writing self-documenting tests/specifications, and executes them concurrently and safely isolated.
200 commits, last change: , 105 stars, 18 forks
pranavraja/zen:
BDD testing framework for Go
31 commits, last change: , 23 stars, 1 forks
qur/withmock:
Automatic Go package mock generation tool
191 commits, last change: , 29 stars, 4 forks
r7kamura/gospel:
BDD-style testing library for Golang
37 commits, last change: , 58 stars, 3 forks
remogatto/prettytest:
A simple testing library for Go
65 commits, last change: , 97 stars, 8 forks
smartystreets/goconvey:
Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.
682 commits, last change: , 862 stars, 58 forks
stretchr/testify:
A sacred extension to the standard go testing package
124 commits, last change: , 266 stars, 23 forks
# Go Test It [](https://travis-ci.org/shageman/gotestit)
Summary from the July presentation: There are a couple of interesting testing libraries in go. "testing" comes with the standard library, and gives only very basic support for asserting facts.
Of the other libraries, I recommend looking at "testify/assert", "zen", and "gocheck". testify/assert is used in conjunction with testing to which it adds a lot of useful assertions, but doesn't change the basics of how a test is written. Zen implements the best version of BDD style testing I have seen in go. Essentially, you write one test into which you embed describes, its, and expects. Like testify/assert "gocheck" comes with many matchers out of the box. Gocheck requires creating a suite struct and uses a non-standard way of running the test methods. Its most useful feature to me are setup and teardown methods to allow tests in a suite to share common code. The shared state can lead to problems with concurrent code.
So, summary of the summary: if you are just trying to test stuff and need assertions, go with testify/assert. If you want to see and play with BDD for go, use zen.
[Slides from my presentation at Denver Gopher's 7/25/2013](https://github.com/shageman/gotestit/blob/master/20130725denverGophersPresentation.pdf)
Comparison of go lang testing libraries
## Libraries in comparison
* testing: http://golang.org/pkg/testing/
Last Activity: -
* testify: https://github.com/stretchr/testify/
Last Activity: 7 days ago on 7/24/2013
* gocheck: http://labix.org/gocheck
Last Activity: 30 days ago on 7/24/2013
* prettytest: https://github.com/remogatto/prettytest
Last Activity: 90 days ago on 7/24/2013
* go-spec: https://github.com/bmatsuo/go-spec
Last Activity: 700 days ago on 7/24/2013
* gospec: https://github.com/orfjackal/gospec
Last Activity: 350 days ago on 7/24/2013
* mao: https://github.com/azer/mao
Last Activity: 17 days ago on 7/9/2013
* zen: https://github.com/pranavraja/zen
License: Apache
Last Activity: 14 days ago on 7/13/2013
## Assertions/Matchers
Name
Testing
testify
gocheck
prettytest
go-spec
gospec
mao/zen
License
BSD
MIT
BSD
MIT
BSD
Apache
MIT/Apache
Assertions
uses gocheck
Style
make your own
assert
spec
spec
spec
spec
spec
Equal
✓
✓
✓
✓
✓
✓
IsSame
✓
DeepEqual
✓
✓
True
✓
✓
False
✓
✓
Nil
✓
✓
✓
✓
✓
Empty
✓
Error
✓
✓
✓
✓
Implements
✓
✓
✓
IsType
✓
✓
✓
StringContains
✓
StringMatches
✓
✓
Collection
✓
Panics
✓
✓
✓
✓
HasLen
✓
✓
Matches
✓
✓
Satisfy
✓
✓
Within
✓
*CollectionContains allows checks for All, Any, Exactly, InOrder, and InPartialOrder
## Sources
https://code.google.com/p/go-wiki/wiki/Projects#Testing