0
0
mirror of https://github.com/thegeeklab/wp-git-clone.git synced 2024-09-19 15:12:46 +02:00
wp-git-clone/git/init_test.go

31 lines
472 B
Go
Raw Normal View History

2024-05-06 21:14:04 +02:00
package git
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestInit(t *testing.T) {
tests := []struct {
name string
repo Repository
expected []string
}{
{
name: "init repo",
repo: Repository{
Branch: "main",
},
expected: []string{gitBin, "init", "-b", "main"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cmd := tt.repo.Init()
assert.Equal(t, tt.expected, cmd.Cmd.Args)
})
}
}