diff options
| author | Carlos Martín Nieto <[email protected]> | 2015-04-24 16:47:42 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2015-04-24 16:47:42 +0200 |
| commit | 9538c7f750dafaf3752e04b1c1747d7984ca31d0 (patch) | |
| tree | 3e37d99c8266d130ea54b2080e20199e8073e99e /status_test.go | |
| parent | e021457f27654ea0f1ec41963c6da62c168be853 (diff) | |
| parent | e300945a3d456af1b619447347cd19a779b7a8f5 (diff) | |
Merge pull request #197 from pks-t/test-cleanups
tests: always clean up temporary repository dirs
Diffstat (limited to 'status_test.go')
| -rw-r--r-- | status_test.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/status_test.go b/status_test.go index d18fca1..5b97b00 100644 --- a/status_test.go +++ b/status_test.go @@ -2,15 +2,13 @@ package git import ( "io/ioutil" - "os" "path" "testing" ) func TestStatusFile(t *testing.T) { repo := createTestRepo(t) - defer repo.Free() - defer os.RemoveAll(repo.Workdir()) + defer cleanupTestRepo(t, repo) state := repo.State() if state != RepositoryStateNone { @@ -30,10 +28,10 @@ func TestStatusFile(t *testing.T) { func TestStatusList(t *testing.T) { repo := createTestRepo(t) + defer cleanupTestRepo(t, repo) + // This commits the test repo README, so it doesn't show up in the status list and there's a head to compare to seedTestRepo(t, repo) - defer repo.Free() - defer os.RemoveAll(repo.Workdir()) err := ioutil.WriteFile(path.Join(path.Dir(repo.Workdir()), "hello.txt"), []byte("Hello, World"), 0644) checkFatal(t, err) |
