Refactor configuration of cache dir and repository

This commit is contained in:
Alexander Neumann 2015-05-09 21:50:10 +02:00
parent 848793df84
commit f5537e7a0e
6 changed files with 57 additions and 43 deletions

View file

@ -3,7 +3,6 @@ package test_helper
import (
"flag"
"io/ioutil"
"os"
"path/filepath"
"testing"
@ -25,10 +24,6 @@ func SetupRepo(t testing.TB) *repository.Repository {
b, err := local.Create(filepath.Join(tempdir, "repo"))
OK(t, err)
// set cache dir below temp dir
err = os.Setenv("RESTIC_CACHE", filepath.Join(tempdir, "cache"))
OK(t, err)
repo := repository.New(b)
OK(t, repo.Init(*TestPassword))
return repo