diff options
Diffstat (limited to 'internal/service/git_test.go')
-rw-r--r-- | internal/service/git_test.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/internal/service/git_test.go b/internal/service/git_test.go deleted file mode 100644 index 6dc8f62..0000000 --- a/internal/service/git_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package service - -import ( - "os/exec" - "path" - "strings" - "testing" - - "git.server.ky/slackcoder/mirror/internal" - "github.com/stretchr/testify/require" -) - -func requireTagExist(t *testing.T, filePath string, tag string, msgAndArgs ...interface{}) { - cmd := exec.Command("git", "tag") - cmd.Dir = filePath - - buf, err := cmd.Output() - require.NoError(t, err) - - tags := strings.Fields(string(buf)) - require.Contains(t, tags, tag, msgAndArgs...) -} - -func TestMirrorGit(t *testing.T) { - d := t.TempDir() - - dst := internal.MustURL(path.Join(d, "merchant")) - src := internal.MustURL("https://git.taler.net/merchant.git") - - err := MirrorGit(dst, src, "GNU Taler Merchant") - require.NoError(t, err, "git mirror") - - requireTagExist(t, dst.Path, "v0.11.3", "tag must exist") -} |