2019-10-26 00:11:34 +03:00
|
|
|
package costello
|
2019-10-31 00:32:47 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/markbates/pkger/pkging"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func RemoveTest(t *testing.T, ref *Ref, pkg pkging.Pkger) {
|
|
|
|
r := require.New(t)
|
|
|
|
|
|
|
|
name := "/go.mod"
|
2019-11-01 22:53:54 +03:00
|
|
|
_, err := LoadFile(name, ref, pkg)
|
2019-11-01 00:20:15 +03:00
|
|
|
r.NoError(err)
|
2019-10-31 00:32:47 +03:00
|
|
|
|
2019-11-01 00:20:15 +03:00
|
|
|
_, err = pkg.Stat(name)
|
2019-10-31 00:32:47 +03:00
|
|
|
r.NoError(err)
|
|
|
|
|
|
|
|
r.NoError(pkg.Remove(name))
|
|
|
|
|
|
|
|
_, err = pkg.Stat(name)
|
|
|
|
r.Error(err)
|
|
|
|
}
|