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

Function TestDelKey

cmd/del_test.go:39–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestDelKey(t *testing.T) {
40 is := is.New(t)
41
42 cfg := &storageMock{
43 DeleteFunc: func(profile string, value string) bool {
44 return true
45 },
46 SaveFunc: func(filename string) error {
47 return nil
48 },
49 }
50
51 var b bytes.Buffer
52
53 cmd := Del(cfg)
54
55 cmd.SetOut(&b)
56 cmd.SetArgs([]string{"profile", "user.name"})
57 err := cmd.Execute()
58
59 is.NoErr(err)
60 is.Equal(trim(b.String()), "Successfully removed `user.name` from `profile` profile.")
61}
62
63func TestDelInteractive(t *testing.T) {
64 is := is.New(t)

Callers

nothing calls this directly

Calls 3

DelFunction · 0.85
trimFunction · 0.85
ExecuteMethod · 0.80

Tested by

no test coverage detected