MCPcopy Create free account
hub / github.com/github/gh-aw / TestUpdateCommand_RemovedFlags

Function TestUpdateCommand_RemovedFlags

pkg/cli/update_integration_test.go:193–210  ·  view source on GitHub ↗

TestUpdateCommand_RemovedFlags verifies that old flags are no longer accepted.

(t *testing.T)

Source from the content-addressed store, hash-verified

191
192// TestUpdateCommand_RemovedFlags verifies that old flags are no longer accepted.
193func TestUpdateCommand_RemovedFlags(t *testing.T) {
194 setup := setupUpdateIntegrationTest(t)
195 defer setup.cleanup()
196
197 removedFlags := []string{"--merge", "--no-actions", "--audit", "--dry-run", "--json"}
198
199 for _, flag := range removedFlags {
200 t.Run(flag, func(t *testing.T) {
201 cmd := exec.Command(setup.binaryPath, "update", flag)
202 cmd.Dir = setup.tempDir
203 output, err := cmd.CombinedOutput()
204 outputStr := string(output)
205
206 assert.Error(t, err, "Should reject removed flag %s", flag)
207 assert.Contains(t, outputStr, "unknown flag", "Should report %s as unknown flag, output: %s", flag, outputStr)
208 })
209 }
210}
211
212// TestUpdateCommand_HelpText verifies the update command help text is correct.
213func TestUpdateCommand_HelpText(t *testing.T) {

Callers

nothing calls this directly

Calls 3

RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected