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:
parent
55bf19e548
commit
4f5e92e4c0
|
@ -305,12 +305,12 @@ func TestInit_targetSubdir(t *testing.T) {
|
||||||
t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
|
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)
|
t.Fatalf("err: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// a data directory should not have been added to out working dir
|
// 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)
|
t.Fatalf("err: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue