hub/commands/push_test.go

26 строки
706 B
Go
Исходник Обычный вид История

2013-07-12 14:31:53 +04:00
package commands
import (
"github.com/github/hub/v2/internal/assert"
2013-07-12 14:31:53 +04:00
"testing"
)
func TestTransformPushArgs(t *testing.T) {
args := NewArgs([]string{"push", "origin,staging,qa", "bert_timeout"})
transformPushArgs(args)
cmds := args.Commands()
2013-07-12 14:31:53 +04:00
assert.Equal(t, 3, len(cmds))
assert.Equal(t, "git push origin bert_timeout", cmds[0].String())
assert.Equal(t, "git push staging bert_timeout", cmds[1].String())
2013-07-12 14:31:53 +04:00
// TODO: travis-ci doesn't have HEAD
//args = NewArgs([]string{"push", "origin"})
//transformPushArgs(args)
//cmds = args.Commands()
//assert.Equal(t, 1, len(cmds))
//pushRegexp := regexp.MustCompile("git push origin .+")
//assert.T(t, pushRegexp.MatchString(cmds[0].String()))
2013-07-12 14:31:53 +04:00
}