2019-10-26 00:11:34 +03:00
|
|
|
package costello
|
2019-10-30 23:39:05 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/markbates/pkger/pkging"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2019-10-30 23:56:22 +03:00
|
|
|
func StatTest(t *testing.T, ref *Ref, pkg pkging.Pkger) {
|
2019-10-30 23:39:05 +03:00
|
|
|
r := require.New(t)
|
|
|
|
|
|
|
|
osi, err := os.Stat(filepath.Join(ref.Dir, "go.mod"))
|
|
|
|
r.NoError(err)
|
|
|
|
|
2019-11-01 00:20:15 +03:00
|
|
|
_, err = LoadFile("/go.mod", pkg)
|
|
|
|
r.NoError(err)
|
2019-10-30 23:39:05 +03:00
|
|
|
psi, err := pkg.Stat("/go.mod")
|
|
|
|
r.NoError(err)
|
|
|
|
|
2019-10-31 18:06:20 +03:00
|
|
|
cmpFileInfo(t, osi, psi)
|
2019-10-30 23:39:05 +03:00
|
|
|
}
|