MCPcopy
hub / github.com/danielmiessler/Fabric / TestSetupQuestion_Ask

Function TestSetupQuestion_Ask

internal/plugins/plugin_test.go:139–154  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

137}
138
139func 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
156func TestSetupQuestion_Ask_Reset(t *testing.T) {
157 // Test that resetting a required field doesn't produce an error

Callers

nothing calls this directly

Calls 2

AskMethod · 0.95
captureInputFunction · 0.85

Tested by

no test coverage detected