MCPcopy Create free account
hub / github.com/dotzero/git-profile / TestProfileResolveInteractiveError

Function TestProfileResolveInteractiveError

cmd/use_test.go:76–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestProfileResolveInteractiveError(t *testing.T) {
77 is := is.New(t)
78
79 cfg := &storageMock{
80 LenFunc: func() int {
81 return 1
82 },
83 NamesFunc: func() []string {
84 return []string{"work"}
85 },
86 }
87
88 _, err := profileResolve(
89 nil,
90 &bytes.Buffer{},
91 &bytes.Buffer{},
92 cfg,
93 func(_ []string, _ io.Reader, _ io.Writer) (string, error) {
94 return "", fmt.Errorf("boom")
95 },
96 )
97
98 is.True(err != nil)
99 is.Equal(err.Error(), "Unable to select a profile: boom")
100}

Callers

nothing calls this directly

Calls 1

profileResolveFunction · 0.85

Tested by

no test coverage detected