pkger/pkging/costello/remove_all.go

25 lines
378 B
Go
Raw Normal View History

package costello
2019-10-31 00:32:47 +03:00
import (
"testing"
"github.com/markbates/pkger/pkging"
"github.com/stretchr/testify/require"
)
func RemoveAllTest(t *testing.T, ref *Ref, pkg pkging.Pkger) {
r := require.New(t)
r.NoError(LoadRef(ref, pkg))
name := "/public/assets"
_, err := pkg.Stat(name)
r.NoError(err)
r.NoError(pkg.RemoveAll(name))
_, err = pkg.Stat(name)
r.Error(err)
}