aboutsummaryrefslogtreecommitdiff
path: root/hotline/file_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'hotline/file_store.go')
-rw-r--r--hotline/file_store.go10
1 files changed, 10 insertions, 0 deletions
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)
+}