fix test broken for OSX; use constants when comparing error messages