Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 518 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 518 Bytes

Minimalistic assertion library

Installation

go get -u github.com/hooklift/assert

Usage

package blah

import (
	"testing"

	"github.com/hooklift/assert"
)

func TestSave(t *testing.T) {
	u := &Account{
		repo:     &RepoMock{},
		Email:    "[email protected]",
		Password: "mypassword",
		Name:     "Camilo Aguilar",
	}

	err := u.Save()
	assert.Ok(t, err)
	assert.Cond(t, u.ID != "", "User ID should not be empty: %v", u)

	u2, err := Get(u.ID)
	assert.Ok(t, err)
	assert.Equals(t, u.ID, u2.ID)
}