pkger/pkging/stdos/stdos_test.go

39 lines
618 B
Go
Raw Permalink Normal View History

2019-10-21 17:27:04 +03:00
package stdos_test
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-10-21 17:27:04 +03:00
"github.com/markbates/pkger/pkging/stdos"
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) {
2019-10-18 22:16:53 +03:00
app, err := pkgtest.App()
2019-09-12 04:29:39 +03:00
if err != nil {
return nil, err
}
2019-10-18 19:01:48 +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-10-18 22:16:53 +03:00
app.Dir = dir
2019-10-09 20:21:54 +03:00
2019-10-21 17:27:04 +03:00
mypkging, err := stdos.New(app.Info)
2019-10-09 20:21:54 +03:00
if err != nil {
return nil, err
}
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)
}