summaryrefslogtreecommitdiff
path: root/odb_test.go
diff options
context:
space:
mode:
authorPatrick Steinhardt <[email protected]>2015-04-24 12:59:29 +0200
committerPatrick Steinhardt <[email protected]>2015-04-24 13:01:51 +0200
commite300945a3d456af1b619447347cd19a779b7a8f5 (patch)
tree3e37d99c8266d130ea54b2080e20199e8073e99e /odb_test.go
parente021457f27654ea0f1ec41963c6da62c168be853 (diff)
tests: always clean up temporary repository dirs
Some test repositories are not correctly removed after the tests did run. Fix by introducing a function that is to be used for cleaning up temporary test repositories.
Diffstat (limited to 'odb_test.go')
-rw-r--r--odb_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/odb_test.go b/odb_test.go
index 5e6b7ff..55ed297 100644
--- a/odb_test.go
+++ b/odb_test.go
@@ -3,13 +3,13 @@ package git
import (
"errors"
"io"
- "os"
"testing"
)
func TestOdbStream(t *testing.T) {
repo := createTestRepo(t)
- defer os.RemoveAll(repo.Workdir())
+ defer cleanupTestRepo(t, repo)
+
_, _ = seedTestRepo(t, repo)
odb, error := repo.Odb()
@@ -38,7 +38,8 @@ func TestOdbStream(t *testing.T) {
func TestOdbHash(t *testing.T) {
repo := createTestRepo(t)
- defer os.RemoveAll(repo.Workdir())
+ defer cleanupTestRepo(t, repo)
+
_, _ = seedTestRepo(t, repo)
odb, error := repo.Odb()
@@ -64,7 +65,8 @@ Initial commit.`
func TestOdbForeach(t *testing.T) {
repo := createTestRepo(t)
- defer os.RemoveAll(repo.Workdir())
+ defer cleanupTestRepo(t, repo)
+
_, _ = seedTestRepo(t, repo)
odb, err := repo.Odb()