[Specifiication] Raise if the string representation is invalid

See CocoaPods/CocoaPods#974