-
Notifications
You must be signed in to change notification settings - Fork 27
/
file_writer_mock.go
88 lines (70 loc) · 2.47 KB
/
file_writer_mock.go
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Code generated by mockery. DO NOT EDIT.
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024 Datadog, Inc.
package injector
import (
fs "io/fs"
mock "github.com/stretchr/testify/mock"
)
// FileWriterMock is an autogenerated mock type for the FileWriter type
type FileWriterMock struct {
mock.Mock
}
type FileWriterMock_Expecter struct {
mock *mock.Mock
}
func (_m *FileWriterMock) EXPECT() *FileWriterMock_Expecter {
return &FileWriterMock_Expecter{mock: &_m.Mock}
}
// Write provides a mock function with given fields: path, mode, data
func (_m *FileWriterMock) Write(path string, mode fs.FileMode, data string) error {
ret := _m.Called(path, mode, data)
if len(ret) == 0 {
panic("no return value specified for Write")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, fs.FileMode, string) error); ok {
r0 = rf(path, mode, data)
} else {
r0 = ret.Error(0)
}
return r0
}
// FileWriterMock_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'
type FileWriterMock_Write_Call struct {
*mock.Call
}
// Write is a helper method to define mock.On call
// - path string
// - mode fs.FileMode
// - data string
func (_e *FileWriterMock_Expecter) Write(path interface{}, mode interface{}, data interface{}) *FileWriterMock_Write_Call {
return &FileWriterMock_Write_Call{Call: _e.mock.On("Write", path, mode, data)}
}
func (_c *FileWriterMock_Write_Call) Run(run func(path string, mode fs.FileMode, data string)) *FileWriterMock_Write_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(fs.FileMode), args[2].(string))
})
return _c
}
func (_c *FileWriterMock_Write_Call) Return(_a0 error) *FileWriterMock_Write_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *FileWriterMock_Write_Call) RunAndReturn(run func(string, fs.FileMode, string) error) *FileWriterMock_Write_Call {
_c.Call.Return(run)
return _c
}
// NewFileWriterMock creates a new instance of FileWriterMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewFileWriterMock(t interface {
mock.TestingT
Cleanup(func())
}) *FileWriterMock {
mock := &FileWriterMock{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}