go-bdd / assert

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assert library Build Status Coverage Status

The aim of this project is to provide very simple and flexible assert library with as less dependencies as possible. What's the main difference comparision to other libraries is that it just return an error when the validation fails. It doesn't provide any complex error reporting.

Usage

Available assertions:

  • Equals
  • NotEquals
  • ObjectsAreEqual
  • Nil
  • NotNil

Here's an example:

package main_test

import "github.com/go-bdd/assert"

func TestEqual(t *testing.T) {
	if err := assert.Equals(1, 2); err == nil {
		t.Errorf("considered numbers should not be equal: %s", err)
	}

	if err := assert.Equals(5, 5); err != nil {
		t.Errorf("considered numbers should be equal: %s", err)
	}
}

About

License:MIT License


Languages

Language:Go 100.0%