MCPcopy
hub / github.com/cli/cli / Test_getBody_prompt

Function Test_getBody_prompt

pkg/cmd/variable/set/set_test.go:420–435  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

418}
419
420func Test_getBody_prompt(t *testing.T) {
421 ios, _, _, _ := iostreams.Test()
422 ios.SetStdinTTY(true)
423 ios.SetStdoutTTY(true)
424 prompterMock := &prompter.PrompterMock{}
425 prompterMock.InputFunc = func(message, defaultValue string) (string, error) {
426 return "a variable", nil
427 }
428 opts := &SetOptions{
429 IO: ios,
430 Prompter: prompterMock,
431 }
432 body, err := getBody(opts)
433 assert.NoError(t, err)
434 assert.Equal(t, "a variable", body)
435}
436
437func Test_getBody(t *testing.T) {
438 tests := []struct {

Callers

nothing calls this directly

Calls 5

TestFunction · 0.92
SetStdinTTYMethod · 0.80
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
getBodyFunction · 0.70

Tested by

no test coverage detected