(t *testing.T)
| 137 | } |
| 138 | |
| 139 | func TestSetupQuestion_Ask(t *testing.T) { |
| 140 | setting := &Setting{ |
| 141 | EnvVariable: "TEST_SETTING", |
| 142 | Required: true, |
| 143 | } |
| 144 | question := &SetupQuestion{ |
| 145 | Setting: setting, |
| 146 | Question: "Enter test setting:", |
| 147 | } |
| 148 | input := "user_value\n" |
| 149 | fmtInput := captureInput(input) |
| 150 | defer fmtInput() |
| 151 | err := question.Ask("TestConfigurable") |
| 152 | assert.NoError(t, err) |
| 153 | assert.Equal(t, "user_value", setting.Value) |
| 154 | } |
| 155 | |
| 156 | func TestSetupQuestion_Ask_Reset(t *testing.T) { |
| 157 | // Test that resetting a required field doesn't produce an error |
nothing calls this directly
no test coverage detected