2013-06-18 00:35:02 +04:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/bmizerany/assert"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestTransformRemoteArgs(t *testing.T) {
|
2013-06-29 01:24:13 +04:00
|
|
|
args := NewArgs([]string{"add", "jingweno"})
|
|
|
|
transformRemoteArgs(args)
|
2013-06-18 00:35:02 +04:00
|
|
|
|
2013-06-26 19:58:15 +04:00
|
|
|
assert.Equal(t, 3, args.Size())
|
|
|
|
assert.Equal(t, "add", args.First())
|
|
|
|
assert.Equal(t, "jingweno", args.Get(1))
|
|
|
|
assert.Equal(t, "git://github.com/jingweno/gh.git", args.Get(2))
|
2013-06-18 00:35:02 +04:00
|
|
|
|
2013-06-29 01:24:13 +04:00
|
|
|
args = NewArgs([]string{"add", "-p", "jingweno"})
|
|
|
|
transformRemoteArgs(args)
|
2013-06-18 00:35:02 +04:00
|
|
|
|
2013-06-26 19:58:15 +04:00
|
|
|
assert.Equal(t, 3, args.Size())
|
|
|
|
assert.Equal(t, "add", args.First())
|
|
|
|
assert.Equal(t, "jingweno", args.Get(1))
|
|
|
|
assert.Equal(t, "git@github.com:jingweno/gh.git", args.Get(2))
|
2013-06-18 00:35:02 +04:00
|
|
|
}
|