提交 f9c7ed72 编写于 作者: T Theodore Kokkoris 提交者: Jingwen Owen Ou

Added tests for gh push

上级 19a1315f
package commands
import (
"github.com/bmizerany/assert"
"testing"
)
func TestGetRemotesRef(t *testing.T) {
args := NewArgs([]string{"push", "origin", "master"})
remotes, ref := getRemotesRef(args)
assert.Equal(t, remotes, []string{"origin"})
assert.Equal(t, ref, "master")
args = NewArgs([]string{"push", "origin"})
remotes, ref = getRemotesRef(args)
assert.Equal(t, remotes, []string{"origin"})
assert.Equal(t, ref, "")
args = NewArgs([]string{"push", "origin,experimental", "master"})
remotes, ref = getRemotesRef(args)
assert.Equal(t, remotes, []string{"origin", "experimental"})
assert.Equal(t, ref, "master")
args = NewArgs([]string{"push", "origin,experimental"})
remotes, ref = getRemotesRef(args)
assert.Equal(t, remotes, []string{"origin", "experimental"})
assert.Equal(t, ref, "")
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册