(t *testing.T)
| 2206 | } |
| 2207 | |
| 2208 | func TestCommand_VersionPrinter(t *testing.T) { |
| 2209 | oldPrinter := VersionPrinter |
| 2210 | defer func() { |
| 2211 | VersionPrinter = oldPrinter |
| 2212 | }() |
| 2213 | |
| 2214 | wasCalled := false |
| 2215 | VersionPrinter = func(*Command) { |
| 2216 | wasCalled = true |
| 2217 | } |
| 2218 | |
| 2219 | cmd := &Command{} |
| 2220 | ShowVersion(cmd) |
| 2221 | |
| 2222 | assert.True(t, wasCalled, "Version printer expected to be called, but was not") |
| 2223 | } |
| 2224 | |
| 2225 | func TestCommand_CommandNotFound(t *testing.T) { |
| 2226 | counts := &opCounts{} |
nothing calls this directly
no test coverage detected