Adapt DirectoryIsEmpty test to create and delete empty directory

This commit is contained in:
Theresa Gresch 2019-07-17 14:59:29 +02:00
parent 8f52e57d9c
commit 5bc213f6f2

View file

@ -51,7 +51,9 @@ func TestDirectoryIsEmpty(t *testing.T) {
t.Run("not existing path", func(t *testing.T) {
assert.Equal(t, false, DirectoryIsEmpty("./xxx"))
})
t.Run("photo-lover", func(t *testing.T) {
t.Run("empty path", func(t *testing.T) {
os.Mkdir("./testdata/emptyDir", 0777)
defer os.RemoveAll("./testdata/emptyDir")
assert.Equal(t, true, DirectoryIsEmpty("./testdata/emptyDir"))
})
}