add test for createDirectoryIfMissing (#2808)