Adding test for pathToRoot