aboutsummaryrefslogtreecommitdiff
path: root/os_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'os_test.go')
-rw-r--r--os_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/os_test.go b/os_test.go
new file mode 100644
index 0000000..17ab09f
--- /dev/null
+++ b/os_test.go
@@ -0,0 +1,26 @@
+package bolt
+
+import (
+ "os"
+
+ "github.com/stretchr/testify/mock"
+)
+
+type mockos struct {
+ mock.Mock
+}
+
+func (m *mockos) OpenFile(name string, flag int, perm os.FileMode) (file *os.File, err error) {
+ args := m.Called(name, flag, perm)
+ return args.Get(0).(*os.File), args.Error(1)
+}
+
+func (m *mockos) Stat(name string) (fi os.FileInfo, err error) {
+ args := m.Called(name)
+ return args.Get(0).(os.FileInfo), args.Error(1)
+}
+
+func (m *mockos) Getpagesize() int {
+ args := m.Called()
+ return args.Int(0)
+}