pkger/pkging/stdos/stdos_test.go

34 lines
543 B
Go
Raw Normal View History

2019-09-03 18:29:28 +03:00
package stdos
2019-09-02 01:02:45 +03:00
import (
2019-09-12 04:29:39 +03:00
"io/ioutil"
2019-09-02 01:02:45 +03:00
"testing"
2019-09-12 04:29:39 +03:00
"github.com/markbates/pkger/pkging"
2019-09-03 18:29:28 +03:00
"github.com/markbates/pkger/pkging/pkgtest"
2019-09-02 01:02:45 +03:00
)
2019-09-03 18:29:28 +03:00
func Test_Pkger(t *testing.T) {
2019-09-12 04:29:39 +03:00
suite, err := pkgtest.NewSuite("stdos", func() (pkging.Pkger, error) {
mypkging, err := New()
if err != nil {
return nil, err
}
2019-09-02 01:02:45 +03:00
2019-09-12 04:29:39 +03:00
dir, err := ioutil.TempDir("", "stdos")
if err != nil {
return nil, err
}
2019-09-02 01:02:45 +03:00
2019-09-12 04:29:39 +03:00
mypkging.current.Dir = dir
mypkging.paths.Current = mypkging.current
2019-09-02 01:02:45 +03:00
2019-09-12 04:29:39 +03:00
return mypkging, nil
})
if err != nil {
t.Fatal(err)
}
2019-09-02 01:02:45 +03:00
suite.Test(t)
}