summaryrefslogtreecommitdiffstats
path: root/integrations/git_helper_for_declarative_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/git_helper_for_declarative_test.go')
-rw-r--r--integrations/git_helper_for_declarative_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/integrations/git_helper_for_declarative_test.go b/integrations/git_helper_for_declarative_test.go
index 5838b9e512..13b3e92c14 100644
--- a/integrations/git_helper_for_declarative_test.go
+++ b/integrations/git_helper_for_declarative_test.go
@@ -115,10 +115,13 @@ func doGitClone(dstLocalPath string, u *url.URL) func(*testing.T) {
}
}
-func doGitCloneFail(dstLocalPath string, u *url.URL) func(*testing.T) {
+func doGitCloneFail(u *url.URL) func(*testing.T) {
return func(t *testing.T) {
- assert.Error(t, git.Clone(u.String(), dstLocalPath, git.CloneRepoOptions{}))
- assert.False(t, com.IsExist(filepath.Join(dstLocalPath, "README.md")))
+ tmpDir, err := ioutil.TempDir("", "doGitCloneFail")
+ assert.NoError(t, err)
+ defer os.RemoveAll(tmpDir)
+ assert.Error(t, git.Clone(u.String(), tmpDir, git.CloneRepoOptions{}))
+ assert.False(t, com.IsExist(filepath.Join(tmpDir, "README.md")))
}
}