Clean up after the tests

This commit is contained in:
Carlos Martín Nieto 2014-03-19 08:03:21 +01:00
parent ad128bdefb
commit 3ae9813fca
2 changed files with 7 additions and 0 deletions

View File

@ -2,18 +2,22 @@ package git
import ( import (
"io/ioutil" "io/ioutil"
"os"
"testing" "testing"
) )
func TestClone(t *testing.T) { func TestClone(t *testing.T) {
repo := createTestRepo(t) repo := createTestRepo(t)
defer os.RemoveAll(repo.Workdir())
seedTestRepo(t, repo) seedTestRepo(t, repo)
path, err := ioutil.TempDir("", "git2go") path, err := ioutil.TempDir("", "git2go")
checkFatal(t, err) checkFatal(t, err)
_, err = Clone(repo.Path(), path, &CloneOptions{Bare: true}) _, err = Clone(repo.Path(), path, &CloneOptions{Bare: true})
defer os.RemoveAll(path)
checkFatal(t, err) checkFatal(t, err)
} }

View File

@ -2,13 +2,16 @@ package git
import ( import (
"log" "log"
"os"
"testing" "testing"
"time" "time"
) )
func Test_Push_ToRemote(t *testing.T) { func Test_Push_ToRemote(t *testing.T) {
repo := createBareTestRepo(t) repo := createBareTestRepo(t)
defer os.RemoveAll(repo.Path())
repo2 := createTestRepo(t) repo2 := createTestRepo(t)
defer os.RemoveAll(repo2.Workdir())
remote, err := repo2.CreateRemote("test_push", repo.Path()) remote, err := repo2.CreateRemote("test_push", repo.Path())
checkFatal(t, err) checkFatal(t, err)