Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 994 Bytes

Readme.md

File metadata and controls

33 lines (24 loc) · 994 Bytes

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)
	}
}