adding a specs and using to_yaml to improve string parsing for errors