shell_mock.go RawHistoryFolder
1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package portsmocks
6
7import (
8 "context"
9
10 "github.com/bnema/vev/internal/ports"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// NewMockShellCommandRunner creates a new instance of MockShellCommandRunner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewMockShellCommandRunner(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *MockShellCommandRunner {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &MockShellCommandRunner{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// MockShellCommandRunner is an autogenerated mock type for the ShellCommandRunner type
38type MockShellCommandRunner struct {
39 mock.Mock
40}
41
42type MockShellCommandRunner_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *MockShellCommandRunner) EXPECT() *MockShellCommandRunner_Expecter {
47 return &MockShellCommandRunner_Expecter{mock: &_m.Mock}
48}
49
50// Run provides a mock function for the type MockShellCommandRunner
51func (_mock *MockShellCommandRunner) Run(ctx context.Context, spec ports.CommandSpec) (ports.ShellCommandResult, error) {
52 ret := _mock.Called(ctx, spec)
53
54 if len(ret) == 0 {
55 panic("no return value specified for Run")
56 }
57
58 var r0 ports.ShellCommandResult
59 var r1 error
60 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CommandSpec) (ports.ShellCommandResult, error)); ok {
61 return returnFunc(ctx, spec)
62 }
63 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CommandSpec) ports.ShellCommandResult); ok {
64 r0 = returnFunc(ctx, spec)
65 } else {
66 r0 = ret.Get(0).(ports.ShellCommandResult)
67 }
68 if returnFunc, ok := ret.Get(1).(func(context.Context, ports.CommandSpec) error); ok {
69 r1 = returnFunc(ctx, spec)
70 } else {
71 r1 = ret.Error(1)
72 }
73 return r0, r1
74}
75
76// MockShellCommandRunner_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run'
77type MockShellCommandRunner_Run_Call struct {
78 *mock.Call
79}
80
81// Run is a helper method to define mock.On call
82// - ctx context.Context
83// - spec ports.CommandSpec
84func (_e *MockShellCommandRunner_Expecter) Run(ctx any, spec any) *MockShellCommandRunner_Run_Call {
85 return &MockShellCommandRunner_Run_Call{Call: _e.mock.On("Run", ctx, spec)}
86}
87
88func (_c *MockShellCommandRunner_Run_Call) Run(run func(ctx context.Context, spec ports.CommandSpec)) *MockShellCommandRunner_Run_Call {
89 _c.Call.Run(func(args mock.Arguments) {
90 var arg0 context.Context
91 if args[0] != nil {
92 arg0 = args[0].(context.Context)
93 }
94 var arg1 ports.CommandSpec
95 if args[1] != nil {
96 arg1 = args[1].(ports.CommandSpec)
97 }
98 run(
99 arg0,
100 arg1,
101 )
102 })
103 return _c
104}
105
106func (_c *MockShellCommandRunner_Run_Call) Return(shellCommandResult ports.ShellCommandResult, err error) *MockShellCommandRunner_Run_Call {
107 _c.Call.Return(shellCommandResult, err)
108 return _c
109}
110
111func (_c *MockShellCommandRunner_Run_Call) RunAndReturn(run func(ctx context.Context, spec ports.CommandSpec) (ports.ShellCommandResult, error)) *MockShellCommandRunner_Run_Call {
112 _c.Call.Return(run)
113 return _c
114}