This commit is contained in:
2023-12-05 19:03:27 +00:00
commit 6859e01192
11 changed files with 288 additions and 0 deletions

28
git/cmd_test.go Normal file
View File

@@ -0,0 +1,28 @@
package git
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// TestExecute runs a unit test with testify for git.Execute
func TestExecute(t *testing.T) {
require := require.New(t)
assert := assert.New(t)
// Create a new git
git := NewGit(&NewGitInput{
Executable: "git",
})
// Run the command
out, err := git.Execute("version")
// Assert that the command ran successfully
require.NoError(err)
// Assert that the output contains 'git version'
assert.Contains(out, "git version")
}