reverse init test to check for dataDir in PWD

init should always write intternal data to the current directory, even
when a path is provided. The inherited behavior no longer applies to the
new use of init.
This commit is contained in:
James Bardin 2017-06-14 15:22:30 -04:00
parent 55bf19e548
commit 4f5e92e4c0
1 changed files with 2 additions and 2 deletions

View File

@ -305,12 +305,12 @@ func TestInit_targetSubdir(t *testing.T) {
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
}
if _, err := os.Stat(filepath.Join(td, "source", DefaultDataDir, DefaultStateFilename)); err != nil {
if _, err := os.Stat(filepath.Join(td, DefaultDataDir, DefaultStateFilename)); err != nil {
t.Fatalf("err: %s", err)
}
// a data directory should not have been added to out working dir
if _, err := os.Stat(filepath.Join(td, DefaultDataDir)); !os.IsNotExist(err) {
if _, err := os.Stat(filepath.Join(td, "source", DefaultDataDir)); !os.IsNotExist(err) {
t.Fatalf("err: %s", err)
}
}