https://github.com/nhatthm/aferoassert
Assert with spf13/afero
https://github.com/nhatthm/aferoassert
afero assert go golang
Last synced: 4 months ago
JSON representation
Assert with spf13/afero
- Host: GitHub
- URL: https://github.com/nhatthm/aferoassert
- Owner: nhatthm
- License: mit
- Created: 2021-05-09T10:30:20.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-14T16:11:51.000Z (10 months ago)
- Last Synced: 2024-10-09T10:20:12.728Z (9 months ago)
- Topics: afero, assert, go, golang
- Language: Go
- Homepage:
- Size: 194 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Assert with spf13/afero
[](https://github.com/nhatthm/aferoassert/releases/latest)
[](https://github.com/nhatthm/aferoassert/actions/workflows/test.yaml)
[](https://codecov.io/gh/nhatthm/aferoassert)
[](https://goreportcard.com/report/go.nhat.io/aferoassert)
[](https://pkg.go.dev/go.nhat.io/aferoassert)
[](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)The logic is shamelessly copy from [stretchr/testify/assert](https://github.com/stretchr/testify/tree/master/assert)
with some salt and pepper.## Prerequisites
- `Go >= 1.17`
## Install
```bash
go get go.nhat.io/aferoassert
```## Usage
```go
package mypackage_testimport (
"testing""github.com/spf13/afero"
"go.nhat.io/aferoassert"
)func TestTreeEqual_Success(t *testing.T) {
osFs := afero.NewOsFs()tree := `
- workflows:
- golangci-lint.yaml
- test.yaml 'perm:"0644"'
`aferoassert.DirExists(t, osFs, ".github")
aferoassert.YAMLTreeEqual(t, osFs, tree, ".github")
}
```## Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)
### Paypal donation
[](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)
or scan this
![]()