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

Function TestProfileResolveInteractive

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

Source from the content-addressed store, hash-verified

47}
48
49func TestProfileResolveInteractive(t *testing.T) {
50 is := is.New(t)
51
52 cfg := &storageMock{
53 LenFunc: func() int {
54 return 2
55 },
56 NamesFunc: func() []string {
57 return []string{"home", "work"}
58 },
59 }
60
61 profile, err := profileResolve(
62 nil,
63 &bytes.Buffer{},
64 &bytes.Buffer{},
65 cfg,
66 func(names []string, _ io.Reader, _ io.Writer) (string, error) {
67 is.Equal(names, []string{"home", "work"})
68 return "work", nil
69 },
70 )
71
72 is.NoErr(err)
73 is.Equal(profile, "work")
74}
75
76func TestProfileResolveInteractiveError(t *testing.T) {
77 is := is.New(t)

Callers

nothing calls this directly

Calls 1

profileResolveFunction · 0.85

Tested by

no test coverage detected