2019-11-01 23:08:10 +03:00
|
|
|
package pkgtest
|
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)
|
|
|
|
|
|
|
|
name := "/public/assets"
|
2019-11-01 00:20:15 +03:00
|
|
|
r.NoError(pkg.MkdirAll(name, 0755))
|
2019-10-31 00:32:47 +03:00
|
|
|
|
|
|
|
_, err := pkg.Stat(name)
|
|
|
|
r.NoError(err)
|
|
|
|
|
|
|
|
r.NoError(pkg.RemoveAll(name))
|
|
|
|
|
|
|
|
_, err = pkg.Stat(name)
|
|
|
|
r.Error(err)
|
|
|
|
}
|