diff --git a/controller_test.go b/controller_test.go index 1e53416d..215a7411 100644 --- a/controller_test.go +++ b/controller_test.go @@ -125,8 +125,8 @@ func TestGetUint64(t *testing.T) { } func TestAdditionalViewPaths(t *testing.T) { - dir1 := "_beeTmp" - dir2 := "_beeTmp2" + dir1 := tmpDir("TestAdditionalViewPaths1") + dir2 := tmpDir("TestAdditionalViewPaths2") defer os.RemoveAll(dir1) defer os.RemoveAll(dir2) diff --git a/template_test.go b/template_test.go index 287faadc..049655db 100644 --- a/template_test.go +++ b/template_test.go @@ -45,8 +45,12 @@ var block = `{{define "block"}}

Hello, blocks!

{{end}}` +func tmpDir(s string) string { + return filepath.Join(os.TempDir(), s) +} + func TestTemplate(t *testing.T) { - dir := "_beeTmp" + dir := tmpDir("TestTemplate") files := []string{ "header.tpl", "index.tpl", @@ -107,7 +111,7 @@ var user = ` ` func TestRelativeTemplate(t *testing.T) { - dir := "_beeTmp" + dir := tmpDir("TestRelativeTemplate") //Just add dir to known viewPaths if err := AddViewPath(dir); err != nil { @@ -218,7 +222,7 @@ var output = ` ` func TestTemplateLayout(t *testing.T) { - dir := "_beeTmp" + dir := tmpDir("TestTemplateLayout") files := []string{ "add.tpl", "layout_blog.tpl",