TestBundleCommandHelp tests that the command help reflects the new expires_on behavior
(t *testing.T)
| 272 | |
| 273 | // TestBundleCommandHelp tests that the command help reflects the new expires_on behavior |
| 274 | func TestBundleCommandHelp(t *testing.T) { |
| 275 | trackBundleCmd := trackBundleCmd(nil, nil, nil) |
| 276 | |
| 277 | // Verify the long description mentions expires_on |
| 278 | assert.Contains(t, trackBundleCmd.Long, "expires_on", |
| 279 | "Command help should mention expires_on") |
| 280 | |
| 281 | // Verify it explains the new behavior |
| 282 | assert.Contains(t, trackBundleCmd.Long, "expiration date is added", |
| 283 | "Command help should explain that expiration dates are added") |
| 284 | |
| 285 | // Verify pruning explanation is updated |
| 286 | assert.Contains(t, trackBundleCmd.Long, "expired entries are removed", |
| 287 | "Command help should explain pruning removes expired entries") |
| 288 | |
| 289 | // Verify the in-effect-days flag is documented |
| 290 | foundFlag := false |
| 291 | trackBundleCmd.Flags().VisitAll(func(flag *pflag.Flag) { |
| 292 | if flag.Name == "in-effect-days" { |
| 293 | foundFlag = true |
| 294 | assert.Equal(t, "60", flag.DefValue, "Default value should be 60") |
| 295 | } |
| 296 | }) |
| 297 | assert.True(t, foundFlag, "in-effect-days flag should exist") |
| 298 | } |
| 299 | |
| 300 | func TestPreRunE(t *testing.T) { |
| 301 | cases := []struct { |
nothing calls this directly
no test coverage detected