Skip to content
/ cogol Public

Modern testing framework for Go programming language

License

Notifications You must be signed in to change notification settings

kyeeego/cogol

Repository files navigation

Cogol

Go Reportcard License: MIT Release Build

Cogol

Why Cogol?

Cogol is a beautiful, easy-configurable tool for writing unit-tests in Go programming language.

Getting started

Install Cogol by running

$ go get github.com/kyeeego/cogol

Next, create typical *_test.go file and copy and paste the following code inside it.

package test

import (
	"github.com/kyeeego/cogol"
	"testing"
)

func TestSomething(t *testing.T) {
	cgl := cogol.Init(t)

	g := cgl.Group("test")
	{
		g.T("Adds two numbers", func(c *cogol.Context) {
			c.Expect(2 + 2).ToBe(4)
		})
	}

	cgl.Process()
}

Run it with

$ go test

and get the following output

Cogol test results

You successfully wrote your first test with Cogol!

Documentation