Use Dir.chdir with a block instead of FileUtils.chdir