https://github.com/hooklift/assert
Minimalist assertion library for Go
https://github.com/hooklift/assert
assert golang minimalistic-assertion-library
Last synced: 9 months ago
JSON representation
Minimalist assertion library for Go
- Host: GitHub
- URL: https://github.com/hooklift/assert
- Owner: hooklift
- License: mpl-2.0
- Created: 2015-02-10T15:38:04.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T18:04:48.000Z (over 5 years ago)
- Last Synced: 2025-03-23T21:35:44.757Z (9 months ago)
- Topics: assert, golang, minimalistic-assertion-library
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 6
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Minimalistic assertion library
## Installation
go get -u github.com/hooklift/assert
### Usage
```go
package blah
import (
"testing"
"github.com/hooklift/assert"
)
func TestSave(t *testing.T) {
u := &Account{
repo: &RepoMock{},
Email: "camilo@hooklift.io",
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)
}
```