6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-07 05:30:39 +00:00

Add function for creating dirs for cloned repos

This commit is contained in:
Grzegorz Dlugoszewski
2020-05-22 10:33:15 +02:00
parent 3cdd1eddf4
commit 2bb6f06962
2 changed files with 32 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
package pkg
import "testing"
import (
"os"
"testing"
)
func TestFetch(t *testing.T) {
// Create origin repo with a single commit in master
@@ -43,3 +46,18 @@ func TestFetch(t *testing.T) {
t.Errorf("Master should not be ahead")
}
}
func TestMakeDir(t *testing.T) {
repoRoot := newTempDir(t)
repoPath := "github.com/grdl/git-get"
dir, err := MakeDir(repoRoot, repoPath)
checkFatal(t, err)
stat, err := os.Stat(dir)
checkFatal(t, err)
if !stat.IsDir() {
t.Errorf("Path is not a directory: %s", dir)
}
}