pkger/fs/memfs/stat_test.go

26 lines
415 B
Go
Raw Normal View History

2019-09-01 00:00:24 +03:00
package memfs
import (
"testing"
"github.com/markbates/pkger/here"
"github.com/stretchr/testify/require"
)
func Test_Stat(t *testing.T) {
r := require.New(t)
fs, err := New(here.Info{})
r.NoError(err)
_, err = fs.Stat("/i.dont.exist")
r.Error(err)
f, err := fs.Create("/i.exist")
r.NoError(err)
r.NoError(f.Close())
fi, err := fs.Stat("/i.exist")
r.NoError(err)
r.Equal("/i.exist", fi.Name())
}