three marlenas

This commit is contained in:
Mark Bates 2019-09-01 17:47:10 -04:00
parent 7779fbd3a9
commit 85055a4cb7
7 changed files with 11 additions and 11 deletions

View File

@ -7,7 +7,7 @@ import (
"github.com/markbates/pkger/here"
)
type FileSystem interface {
type Warehouse interface {
Parse(p string) (Path, error)
Abs(string) (string, error)
AbsPath(Path) (string, error)

View File

@ -4,7 +4,7 @@ import (
"github.com/markbates/pkger/fs"
)
func Files(fx fs.FileSystem) (TestFiles, error) {
func Files(fx fs.Warehouse) (TestFiles, error) {
tf := TestFiles{}
for _, f := range fileList {
pt, err := fx.Parse(f)

View File

@ -18,12 +18,12 @@ const hart = "/easy/listening/grant.hart"
const husker = "github.com/husker/du"
type Suite struct {
fs.FileSystem
fs.Warehouse
}
func NewSuite(yourfs fs.FileSystem) (Suite, error) {
func NewSuite(yourfs fs.Warehouse) (Suite, error) {
suite := Suite{
FileSystem: yourfs,
Warehouse: yourfs,
}
return suite, nil
}
@ -45,7 +45,7 @@ func (s Suite) Test(t *testing.T) {
func (s Suite) sub(t *testing.T, m reflect.Method) {
name := strings.TrimPrefix(m.Name, "Test_")
name = fmt.Sprintf("%T_%s", s.FileSystem, name)
name = fmt.Sprintf("%T_%s", s.Warehouse, name)
t.Run(name, func(st *testing.T) {
defer func() {
if err := recover(); err != nil {

View File

@ -15,10 +15,10 @@ type File struct {
info *fs.FileInfo
her here.Info
path fs.Path
fs fs.FileSystem
fs fs.Warehouse
}
func NewFile(fx fs.FileSystem, osf *os.File) (*File, error) {
func NewFile(fx fs.Warehouse, osf *os.File) (*File, error) {
pt, err := fx.Parse(osf.Name())
if err != nil {

View File

@ -12,7 +12,7 @@ import (
"github.com/markbates/pkger/internal/maps"
)
var _ fs.FileSystem = &FS{}
var _ fs.Warehouse = &FS{}
type FS struct {
infos *maps.Infos

View File

@ -27,7 +27,7 @@ type File struct {
parent fs.Path
writer *bytes.Buffer
reader io.Reader
fs fs.FileSystem
fs fs.Warehouse
}
func (f *File) Seek(offset int64, whence int) (int64, error) {

View File

@ -11,7 +11,7 @@ import (
"github.com/markbates/pkger/internal/maps"
)
var _ fs.FileSystem = &FS{}
var _ fs.Warehouse = &FS{}
func WithInfo(fx *FS, infos ...here.Info) {
for _, info := range infos {