MCPcopy
hub / github.com/urfave/cli / TestCommand_SetStdout

Function TestCommand_SetStdout

command_test.go:1574–1585  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1572}
1573
1574func TestCommand_SetStdout(t *testing.T) {
1575 var w bytes.Buffer
1576
1577 cmd := &Command{
1578 Name: "test",
1579 Writer: &w,
1580 }
1581
1582 err := cmd.Run(buildTestContext(t), []string{"help"})
1583 require.NoError(t, err)
1584 assert.NotZero(t, w.Len(), "Command did not write output to desired writer.")
1585}
1586
1587func TestCommand_BeforeFunc(t *testing.T) {
1588 counts := &opCounts{}

Callers

nothing calls this directly

Calls 3

RunMethod · 0.95
buildTestContextFunction · 0.85
LenMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…