Added directory_with_contents() to DRY up test code and ensure folders exist in TestCommand.