magefiles/packagecloud/mock_execFunc.go (79 lines of code) (raw):

// Code generated by mockery v2.53.3. DO NOT EDIT. package packagecloud import ( io "io" mock "github.com/stretchr/testify/mock" ) // mockExecFunc is an autogenerated mock type for the execFunc type type mockExecFunc struct { mock.Mock } type mockExecFunc_Expecter struct { mock *mock.Mock } func (_m *mockExecFunc) EXPECT() *mockExecFunc_Expecter { return &mockExecFunc_Expecter{mock: &_m.Mock} } // Execute provides a mock function with given fields: env, stdout, stderr, cmd, args func (_m *mockExecFunc) Execute(env map[string]string, stdout io.Writer, stderr io.Writer, cmd string, args ...string) (bool, error) { _va := make([]interface{}, len(args)) for _i := range args { _va[_i] = args[_i] } var _ca []interface{} _ca = append(_ca, env, stdout, stderr, cmd) _ca = append(_ca, _va...) ret := _m.Called(_ca...) if len(ret) == 0 { panic("no return value specified for Execute") } var r0 bool var r1 error if rf, ok := ret.Get(0).(func(map[string]string, io.Writer, io.Writer, string, ...string) (bool, error)); ok { return rf(env, stdout, stderr, cmd, args...) } if rf, ok := ret.Get(0).(func(map[string]string, io.Writer, io.Writer, string, ...string) bool); ok { r0 = rf(env, stdout, stderr, cmd, args...) } else { r0 = ret.Get(0).(bool) } if rf, ok := ret.Get(1).(func(map[string]string, io.Writer, io.Writer, string, ...string) error); ok { r1 = rf(env, stdout, stderr, cmd, args...) } else { r1 = ret.Error(1) } return r0, r1 } // mockExecFunc_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute' type mockExecFunc_Execute_Call struct { *mock.Call } // Execute is a helper method to define mock.On call // - env map[string]string // - stdout io.Writer // - stderr io.Writer // - cmd string // - args ...string func (_e *mockExecFunc_Expecter) Execute(env interface{}, stdout interface{}, stderr interface{}, cmd interface{}, args ...interface{}) *mockExecFunc_Execute_Call { return &mockExecFunc_Execute_Call{Call: _e.mock.On("Execute", append([]interface{}{env, stdout, stderr, cmd}, args...)...)} } func (_c *mockExecFunc_Execute_Call) Run(run func(env map[string]string, stdout io.Writer, stderr io.Writer, cmd string, args ...string)) *mockExecFunc_Execute_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]string, len(args)-4) for i, a := range args[4:] { if a != nil { variadicArgs[i] = a.(string) } } run(args[0].(map[string]string), args[1].(io.Writer), args[2].(io.Writer), args[3].(string), variadicArgs...) }) return _c } func (_c *mockExecFunc_Execute_Call) Return(ran bool, err error) *mockExecFunc_Execute_Call { _c.Call.Return(ran, err) return _c } func (_c *mockExecFunc_Execute_Call) RunAndReturn(run func(map[string]string, io.Writer, io.Writer, string, ...string) (bool, error)) *mockExecFunc_Execute_Call { _c.Call.Return(run) return _c } // newMockExecFunc creates a new instance of mockExecFunc. 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 newMockExecFunc(t interface { mock.TestingT Cleanup(func()) }) *mockExecFunc { mock := &mockExecFunc{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }