generateDocs runs the doc command into a temp directory and returns the path. Shared by multiple tests so we only generate once per test run.
(t *testing.T)
| 37 | // generateDocs runs the doc command into a temp directory and returns the path. |
| 38 | // Shared by multiple tests so we only generate once per test run. |
| 39 | func generateDocs(t *testing.T) string { |
| 40 | t.Helper() |
| 41 | tmpDir := t.TempDir() |
| 42 | cmd := NewCmdRoot() |
| 43 | cmd.SetArgs(append([]string{"doc", tmpDir}, testCommandArgs(t)...)) |
| 44 | require.NoError(t, cmd.Execute()) |
| 45 | return tmpDir |
| 46 | } |
| 47 | |
| 48 | func TestDoc(t *testing.T) { |
| 49 | tmpDir := generateDocs(t) |
no test coverage detected