MCPcopy
hub / github.com/spf13/cobra / TestGenMdDocWithNoLongOrSynopsis

Function TestGenMdDocWithNoLongOrSynopsis

doc/md_docs_test.go:44–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestGenMdDocWithNoLongOrSynopsis(t *testing.T) {
45 // We generate on subcommand so we have both subcommands and parents.
46 buf := new(bytes.Buffer)
47 if err := GenMarkdown(dummyCmd, buf); err != nil {
48 t.Fatal(err)
49 }
50 output := buf.String()
51
52 checkStringContains(t, output, dummyCmd.Example)
53 checkStringContains(t, output, dummyCmd.Short)
54 checkStringContains(t, output, "Options inherited from parent commands")
55 checkStringOmits(t, output, "### Synopsis")
56}
57
58func TestGenMdNoHiddenParents(t *testing.T) {
59 // We generate on subcommand so we have both subcommands and parents.

Callers

nothing calls this directly

Calls 4

GenMarkdownFunction · 0.85
StringMethod · 0.80
checkStringContainsFunction · 0.70
checkStringOmitsFunction · 0.70

Tested by

no test coverage detected