This is the test for a string, not a Pathname, I think you accidentally left the wrong test in?