pkger/pkging/stdos/stdos_test.go

38 lines
594 B
Go
Raw Permalink 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-10-09 20:21:54 +03:00
"github.com/markbates/pkger/here"
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) {
2019-10-09 20:21:54 +03:00
her, err := here.Current()
2019-09-12 04:29:39 +03:00
if err != nil {
return nil, err
}
dir, err := ioutil.TempDir("", "stdos")
if err != nil {
return nil, err
}
2019-09-02 01:02:45 +03:00
2019-10-09 20:21:54 +03:00
her.Dir = dir
mypkging, err := New(her)
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)
}