// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package portsmocks import ( "context" "github.com/bnema/vev/internal/ports" mock "github.com/stretchr/testify/mock" ) // 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. // The first argument is typically a *testing.T value. func NewMockShellCommandRunner(t interface { mock.TestingT Cleanup(func()) }) *MockShellCommandRunner { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &MockShellCommandRunner{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // MockShellCommandRunner is an autogenerated mock type for the ShellCommandRunner type type MockShellCommandRunner struct { mock.Mock } type MockShellCommandRunner_Expecter struct { mock *mock.Mock } func (_m *MockShellCommandRunner) EXPECT() *MockShellCommandRunner_Expecter { return &MockShellCommandRunner_Expecter{mock: &_m.Mock} } // Run provides a mock function for the type MockShellCommandRunner func (_mock *MockShellCommandRunner) Run(ctx context.Context, spec ports.CommandSpec) (ports.ShellCommandResult, error) { ret := _mock.Called(ctx, spec) if len(ret) == 0 { panic("no return value specified for Run") } var r0 ports.ShellCommandResult var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CommandSpec) (ports.ShellCommandResult, error)); ok { return returnFunc(ctx, spec) } if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CommandSpec) ports.ShellCommandResult); ok { r0 = returnFunc(ctx, spec) } else { r0 = ret.Get(0).(ports.ShellCommandResult) } if returnFunc, ok := ret.Get(1).(func(context.Context, ports.CommandSpec) error); ok { r1 = returnFunc(ctx, spec) } else { r1 = ret.Error(1) } return r0, r1 } // MockShellCommandRunner_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' type MockShellCommandRunner_Run_Call struct { *mock.Call } // Run is a helper method to define mock.On call // - ctx context.Context // - spec ports.CommandSpec func (_e *MockShellCommandRunner_Expecter) Run(ctx any, spec any) *MockShellCommandRunner_Run_Call { return &MockShellCommandRunner_Run_Call{Call: _e.mock.On("Run", ctx, spec)} } func (_c *MockShellCommandRunner_Run_Call) Run(run func(ctx context.Context, spec ports.CommandSpec)) *MockShellCommandRunner_Run_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 ports.CommandSpec if args[1] != nil { arg1 = args[1].(ports.CommandSpec) } run( arg0, arg1, ) }) return _c } func (_c *MockShellCommandRunner_Run_Call) Return(shellCommandResult ports.ShellCommandResult, err error) *MockShellCommandRunner_Run_Call { _c.Call.Return(shellCommandResult, err) return _c } func (_c *MockShellCommandRunner_Run_Call) RunAndReturn(run func(ctx context.Context, spec ports.CommandSpec) (ports.ShellCommandResult, error)) *MockShellCommandRunner_Run_Call { _c.Call.Return(run) return _c }