TestSpec_PublicAPI_GetEngineOption validates the documented GetEngineOption function. Spec section: "// Get engine metadata"
(t *testing.T)
| 66 | // TestSpec_PublicAPI_GetEngineOption validates the documented GetEngineOption function. |
| 67 | // Spec section: "// Get engine metadata" |
| 68 | func TestSpec_PublicAPI_GetEngineOption(t *testing.T) { |
| 69 | t.Run("GetEngineOption returns EngineOption for known engine", func(t *testing.T) { |
| 70 | // Spec documents: opt := constants.GetEngineOption("copilot") |
| 71 | // opt.Label = "GitHub Copilot" |
| 72 | // opt.SecretName = "COPILOT_GITHUB_TOKEN" |
| 73 | opt := constants.GetEngineOption("copilot") |
| 74 | require.NotNil(t, opt, "GetEngineOption should return non-nil for documented engine 'copilot'") |
| 75 | assert.Equal(t, "GitHub Copilot", opt.Label, |
| 76 | "copilot EngineOption.Label should be 'GitHub Copilot' as documented") |
| 77 | assert.Equal(t, "COPILOT_GITHUB_TOKEN", opt.SecretName, |
| 78 | "copilot EngineOption.SecretName should be 'COPILOT_GITHUB_TOKEN' as documented") |
| 79 | }) |
| 80 | |
| 81 | t.Run("GetEngineOption returns nil for unknown engine", func(t *testing.T) { |
| 82 | // Spec documents GetEngineOption returns nil for unknown engine values |
| 83 | opt := constants.GetEngineOption("unknown-engine-xyz") |
| 84 | assert.Nil(t, opt, "GetEngineOption should return nil for unknown engine names") |
| 85 | }) |
| 86 | |
| 87 | t.Run("EngineOption has documented fields", func(t *testing.T) { |
| 88 | // Spec documents EngineOption fields: Value, Label, Description, SecretName, |
| 89 | // AlternativeSecrets, EnvVarName, KeyURL, WhenNeeded |
| 90 | opt := constants.GetEngineOption("copilot") |
| 91 | require.NotNil(t, opt) |
| 92 | |
| 93 | assert.NotEmpty(t, opt.Value, "EngineOption.Value should be non-empty") |
| 94 | assert.NotEmpty(t, opt.Label, "EngineOption.Label should be non-empty") |
| 95 | assert.NotEmpty(t, opt.SecretName, "EngineOption.SecretName should be non-empty") |
| 96 | assert.NotEmpty(t, opt.KeyURL, "EngineOption.KeyURL should be non-empty") |
| 97 | }) |
| 98 | } |
| 99 | |
| 100 | // TestSpec_PublicAPI_GetAllEngineSecretNames validates the documented helper function. |
| 101 | // Spec section: "// Get all secret names for all engines" |
nothing calls this directly
no test coverage detected