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

Function TestCurrent

cmd/current_test.go:10–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestCurrent(t *testing.T) {
11 is := is.New(t)
12
13 cfg := &storageMock{
14 LenFunc: func() int {
15 return 1
16 },
17 }
18
19 vcs := &vcsMock{
20 IsRepositoryFunc: func() bool {
21 return true
22 },
23 GetFunc: func(key string) (string, error) {
24 return "home", nil
25 },
26 }
27
28 var b bytes.Buffer
29
30 cmd := Current(cfg, vcs)
31
32 cmd.SetOut(&b)
33 err := cmd.Execute()
34
35 is.NoErr(err)
36 is.Equal(trim(b.String()), "Current profile: home")
37}

Callers

nothing calls this directly

Calls 3

CurrentFunction · 0.85
trimFunction · 0.85
ExecuteMethod · 0.80

Tested by

no test coverage detected