MCPcopy
hub / github.com/cli/cli / LogRendererMock

Struct LogRendererMock

pkg/cmd/agent-task/shared/log_mock.go:34–64  ·  view source on GitHub ↗

LogRendererMock is a mock implementation of LogRenderer. func TestSomethingThatUsesLogRenderer(t *testing.T) { // make and configure a mocked LogRenderer mockedLogRenderer := &LogRendererMock{ FollowFunc: func(fetcher func() ([]byte, error), w io.Writer, ioMoqParam *iostreams.IOStreams) er

Source from the content-addressed store, hash-verified

32//
33// }
34type LogRendererMock struct {
35 // FollowFunc mocks the Follow method.
36 FollowFunc func(fetcher func() ([]byte, error), w io.Writer, ioMoqParam *iostreams.IOStreams) error
37
38 // RenderFunc mocks the Render method.
39 RenderFunc func(logs []byte, w io.Writer, ioMoqParam *iostreams.IOStreams) (bool, error)
40
41 // calls tracks calls to the methods.
42 calls struct {
43 // Follow holds details about calls to the Follow method.
44 Follow []struct {
45 // Fetcher is the fetcher argument value.
46 Fetcher func() ([]byte, error)
47 // W is the w argument value.
48 W io.Writer
49 // IoMoqParam is the ioMoqParam argument value.
50 IoMoqParam *iostreams.IOStreams
51 }
52 // Render holds details about calls to the Render method.
53 Render []struct {
54 // Logs is the logs argument value.
55 Logs []byte
56 // W is the w argument value.
57 W io.Writer
58 // IoMoqParam is the ioMoqParam argument value.
59 IoMoqParam *iostreams.IOStreams
60 }
61 }
62 lockFollow sync.RWMutex
63 lockRender sync.RWMutex
64}
65
66// Follow calls FollowFunc.
67func (mock *LogRendererMock) Follow(fetcher func() ([]byte, error), w io.Writer, ioMoqParam *iostreams.IOStreams) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected