Skip to content

mindreframer/golang-testing-stuff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 Build Status

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

Comparison of go lang testing libraries

Libraries in comparison

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published