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

Function TestMain_execWithExitStatus_versionFlag

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

Source from the content-addressed store, hash-verified

31}
32
33func TestMain_execWithExitStatus_versionFlag(t *testing.T) {
34 StubCommandLineArgs("-V")
35 assert.True(t, *fVersion)
36
37 execStdOut := WithStdoutCaptured(func() {
38 result := execWithExitStatus()
39 assert.Equal(t, 0, result.exitStatusCode)
40 assert.Equal(t, true, result.shouldExit)
41 })
42
43 assert.Regexp(t, "^Version: devel \\(.+\\)\\n$", execStdOut)
44}
45
46func TestMain_execWithExitStatus_noFlag(t *testing.T) {
47 StubCommandLineArgs()

Callers

nothing calls this directly

Calls 3

StubCommandLineArgsFunction · 0.85
WithStdoutCapturedFunction · 0.85
execWithExitStatusFunction · 0.85

Tested by

no test coverage detected