X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/25f0d77de4489c6759a497617606f2933ca76fc9..85767504e4dc622c5ff469733e49c0cebcee57f1:/hotline/file_store.go?ds=sidebyside diff --git a/hotline/file_store.go b/hotline/file_store.go index e9d083f..ed0ffa4 100644 --- a/hotline/file_store.go +++ b/hotline/file_store.go @@ -13,6 +13,7 @@ type FileStore interface { Open(name string) (*os.File, error) Symlink(oldname, newname string) error Remove(name string) error + Create(name string) (*os.File, error) // TODO: implement these // Rename(oldpath string, newpath string) error // RemoveAll(path string) error @@ -40,6 +41,10 @@ func (fs *OSFileStore) Remove(name string) error { return os.Remove(name) } +func (fs *OSFileStore) Create(name string) (*os.File, error) { + return os.Create(name) +} + type MockFileStore struct { mock.Mock } @@ -72,3 +77,8 @@ func (mfs *MockFileStore) Remove(name string) error { args := mfs.Called(name) return args.Error(0) } + +func (mfs *MockFileStore) Create(name string) (*os.File, error) { + args := mfs.Called(name) + return args.Get(0).(*os.File), args.Error(1) +}