MCPcopy
hub / github.com/mislav/hub / TestTransformPushArgs

Function TestTransformPushArgs

commands/push_test.go:19–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestTransformPushArgs(t *testing.T) {
20 args := NewArgs([]string{"push", "origin,staging,qa", "bert_timeout"})
21 transformPushArgs(args)
22 cmds := args.Commands()
23
24 assert.Equal(t, 3, len(cmds))
25 assert.Equal(t, "git push origin bert_timeout", cmds[0].String())
26 assert.Equal(t, "git push staging bert_timeout", cmds[1].String())
27
28 // TODO: travis-ci doesn't have HEAD
29 //args = NewArgs([]string{"push", "origin"})
30 //transformPushArgs(args)
31 //cmds = args.Commands()
32
33 //assert.Equal(t, 1, len(cmds))
34 //pushRegexp := regexp.MustCompile("git push origin .+")
35 //assert.T(t, pushRegexp.MatchString(cmds[0].String()))
36}

Callers

nothing calls this directly

Calls 4

CommandsMethod · 0.95
NewArgsFunction · 0.85
transformPushArgsFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…