0
0
mirror of https://github.com/thegeeklab/wp-git-clone.git synced 2024-11-24 23:10:40 +00:00
wp-git-clone/git/remote_test.go

32 lines
594 B
Go
Raw Permalink Normal View History

2024-05-06 19:14:04 +00:00
package git
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestRemoteAdd(t *testing.T) {
tests := []struct {
name string
repo Repository
want []string
}{
{
name: "add remote with valid inputs",
repo: Repository{
RemoteURL: "https://example.com/repo.git",
},
want: []string{gitBin, "remote", "add", "origin", "https://example.com/repo.git"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cmd := tt.repo.RemoteAdd()
assert.Equal(t, tt.want, cmd.Cmd.Args)
assert.Equal(t, tt.repo.WorkDir, cmd.Cmd.Dir)
})
}
}