Skip to content

nhatthm/aferoassert

Repository files navigation

Assert with spf13/afero

GitHub Releases Build Status codecov Go Report Card GoDevDoc Donate

The logic is shamelessly copy from stretchr/testify/assert with some salt and pepper.

Prerequisites

  • Go >= 1.17

Install

go get go.nhat.io/aferoassert

Usage

package mypackage_test

import (
	"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

paypal

       or scan this