aboutsummaryrefslogtreecommitdiff
path: root/os_test.go
blob: 17ab09f91fc330f8bb4d76da634bf75daa379ccf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)
}