You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import (
"io/fs""github.com/stretchr/testify/mock""github.com/parrogo/writefs"
)
// # TODO: add an example file// FileWriter provides a struct based on testify/mock.Mock// that implements the fs.Writer.//// The struct is used to test the writefs package itself,// and could be generally used to test methods that// expects a writefs.WriteFS instance, by providing a// mocked FileWriter type that you can return from you mocked// writefs.WriteFS objects.typeFileWriterstruct {
mock.Mock
}
var_ writefs.FileWriter=&FileWriter{}
// Close implements fs.Closefunc (w*FileWriter) Close() error {
args:=w.Called()
returnargs.Error(0)
}
// Write implements writefs.Writefunc (w*FileWriter) Write(buf []byte) (int, error) {
args:=w.Called(buf)
returnargs.Int(0), args.Error(1)
}
// Read implements fs.Readfunc (w*FileWriter) Read(buf []byte) (int, error) {
args:=w.Called(buf)
returnargs.Int(0), args.Error(1)
}
// Stat implements fs.Filefunc (w*FileWriter) Stat() (fs.FileInfo, error) {
args:=w.Called()
res:=args.Get(0)
ifres==nil {
returnnil, args.Error(1)
}
returnres.(fs.FileInfo), args.Error(1)
}
ewfilemode100644ndex0000000..33b1910++b/mock/fixtures/dir1/dir2/file3.txt.template
48adb6fac8bf482a823a7541a6f6184eb4571b2f
The text was updated successfully, but these errors were encountered:
add an example file
writefs/mock/filewriter.go
Line 11 in 021cd63
48adb6fac8bf482a823a7541a6f6184eb4571b2f
The text was updated successfully, but these errors were encountered: