Skip to content

Commit

Permalink
Added a test for AllocDir.LogDir
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu committed Feb 25, 2016
1 parent be55af6 commit 9458106
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions client/allocdir/alloc_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ func TestAllocDir_BuildAlloc(t *testing.T) {
}
}

func TestAllocDir_LogDir(t *testing.T) {
tmp, err := ioutil.TempDir("", "AllocDir")
if err != nil {
t.Fatalf("Couldn't create temp dir: %v", err)
}
defer os.RemoveAll(tmp)

d := NewAllocDir(tmp)
defer d.Destroy()

expected := filepath.Join(d.AllocDir, SharedAllocName, LogDirName)
if d.LogDir() != expected {
t.Fatalf("expected: %v, got: %v", expected, d.LogDir())
}
}

func TestAllocDir_EmbedNonExistent(t *testing.T) {
tmp, err := ioutil.TempDir("", "AllocDir")
if err != nil {
Expand Down

0 comments on commit 9458106

Please sign in to comment.