mirror of
https://github.com/grdl/git-get.git
synced 2026-02-09 15:34:17 +00:00
Use t.Cleanup instead of defer to cleanup after tests
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
func TestStatusWithEmptyRepo(t *testing.T) {
|
||||
repo := newTestRepo(t)
|
||||
defer cleanupRepo(t, repo)
|
||||
|
||||
entries, err := statusEntries(repo)
|
||||
checkFatal(t, err)
|
||||
@@ -27,8 +26,6 @@ func TestStatusWithEmptyRepo(t *testing.T) {
|
||||
|
||||
func TestStatusWithUntrackedFile(t *testing.T) {
|
||||
repo := newTestRepo(t)
|
||||
defer cleanupRepo(t, repo)
|
||||
|
||||
createFile(t, repo, "SomeFile")
|
||||
|
||||
entries, err := statusEntries(repo)
|
||||
@@ -60,8 +57,6 @@ func TestStatusWithUntrackedButIgnoredFile(t *testing.T) {
|
||||
|
||||
func TestStatusWithStagedFile(t *testing.T) {
|
||||
repo := newTestRepo(t)
|
||||
defer cleanupRepo(t, repo)
|
||||
|
||||
createFile(t, repo, "SomeFile")
|
||||
stageFile(t, repo, "SomeFile")
|
||||
|
||||
@@ -86,8 +81,6 @@ func TestStatusWithStagedFile(t *testing.T) {
|
||||
|
||||
func TestStatusWithSingleCommit(t *testing.T) {
|
||||
repo := newTestRepo(t)
|
||||
defer cleanupRepo(t, repo)
|
||||
|
||||
createFile(t, repo, "SomeFile")
|
||||
stageFile(t, repo, "SomeFile")
|
||||
createCommit(t, repo, "Initial commit")
|
||||
@@ -109,8 +102,6 @@ func TestStatusWithSingleCommit(t *testing.T) {
|
||||
|
||||
func TestStatusWithMultipleCommits(t *testing.T) {
|
||||
repo := newTestRepo(t)
|
||||
defer cleanupRepo(t, repo)
|
||||
|
||||
createFile(t, repo, "SomeFile")
|
||||
stageFile(t, repo, "SomeFile")
|
||||
createCommit(t, repo, "Initial commit")
|
||||
|
||||
Reference in New Issue
Block a user