aboutsummaryrefslogtreecommitdiff
path: root/file_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'file_test.go')
-rw-r--r--file_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/file_test.go b/file_test.go
new file mode 100644
index 0000000..3f33d14
--- /dev/null
+++ b/file_test.go
@@ -0,0 +1,29 @@
+package bolt
+
+import (
+ "github.com/stretchr/testify/mock"
+)
+
+type mockfile struct {
+ mock.Mock
+ fd uintptr
+ name string
+}
+
+func (m *mockfile) Fd() uintptr {
+ return m.fd
+}
+
+func (m *mockfile) Name() string {
+ return m.name
+}
+
+func (m *mockfile) ReadAt(b []byte, off int64) (n int, err error) {
+ args := m.Called(b, off)
+ return args.Int(0), args.Error(1)
+}
+
+func (m *mockfile) WriteAt(b []byte, off int64) (n int, err error) {
+ args := m.Called(b, off)
+ return args.Int(0), args.Error(1)
+}