MCPcopy
hub / github.com/puma/puma-dev / TestMain_execWithExitStatus_commandArgs

Function TestMain_execWithExitStatus_commandArgs

cmd/puma-dev/main_test.go:58–68  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func TestMain_execWithExitStatus_commandArgs(t *testing.T) {
59 StubCommandLineArgs("nosoupforyou")
60
61 execStdOut := WithStdoutCaptured(func() {
62 result := execWithExitStatus()
63 assert.Equal(t, 1, result.exitStatusCode)
64 assert.Equal(t, true, result.shouldExit)
65 })
66
67 assert.Equal(t, "Error: unknown command: nosoupforyou\n", execStdOut)
68}
69
70func TestMain_allCheck_versionFlag(t *testing.T) {
71 if os.Getenv("GO_TEST_SUBPROCESS") == "1" {

Callers

nothing calls this directly

Calls 3

StubCommandLineArgsFunction · 0.85
WithStdoutCapturedFunction · 0.85
execWithExitStatusFunction · 0.85

Tested by

no test coverage detected