MemFSTest.Rmdir_NonEmpty

geesefs-0-30-9
Aaron Jacobs 2015-03-03 14:34:28 +11:00
parent ea5370d6f1
commit 98f868c319
1 changed files with 11 additions and 1 deletions

View File

@ -324,7 +324,17 @@ func (t *MemFSTest) UnlinkFile_NonExistent() {
}
func (t *MemFSTest) Rmdir_NonEmpty() {
AssertTrue(false, "TODO")
var err error
// Create two levels of directories.
err = os.MkdirAll(path.Join(t.mfs.Dir(), "foo/bar"), 0754)
AssertEq(nil, err)
// Attempt to remove the parent.
err = os.Remove(path.Join(t.mfs.Dir(), "foo"))
AssertNe(nil, err)
ExpectThat(err, Error(HasSubstr("non-empty")))
}
func (t *MemFSTest) Rmdir_Empty() {