github.com/cobalt77/jfrog-client-go@v0.14.5/utils/git_test.go (about) 1 package utils 2 3 import ( 4 "path/filepath" 5 "testing" 6 7 "github.com/cobalt77/jfrog-client-go/utils/io/fileutils" 8 "github.com/stretchr/testify/assert" 9 ) 10 11 func TestGitManager(t *testing.T) { 12 // Test the following .git types, on their corresponding paths in testdata. 13 tests := []string{"vcs", "packedVcs"} 14 for _, test := range tests { 15 t.Run(test, func(t *testing.T) { 16 projectPath, tmpDir := initVcsTestDir(t, filepath.Join("testdata", test)) 17 defer fileutils.RemoveTempDir(tmpDir) 18 gitManager := NewGitManager(projectPath) 19 err := gitManager.ReadConfig() 20 assert.NoError(t, err) 21 assert.Equal(t, "https://github.com/jfrog/jfrog-cli.git", gitManager.GetUrl()) 22 assert.Equal(t, "d63c5957ad6819f4c02a817abe757f210d35ff92", gitManager.GetRevision()) 23 }) 24 } 25 }