New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem Testing Constructor Exceptions #642
Comments
if ($longitude < 180 || $longitude > 180) {
throw new InvalidLongitudeException();
} Your only valid longitude is exactly 180..., you probably want to check for |
Gah! I'm an idiot! 😄 Thanks, @ciaranmcnulty! |
The tests were telling you what was happening ;-) |
It's a bit weird that one of them still passed though... And removing either one made the other one pass |
What may be confusing the issue is that your first spec won't be failing; shouldHaveType doesn't actually cause instantiation |
Yes... That, and the expected exception class type was truncated |
I've got a constructor that accepts two
double
parameters. It fires off the setting to two different methods and each has the potential to throw an exception. I can't get my specs to pass, no matter what I do.The full code is here: https://gist.github.com/mdavis1982/50ea2507d3603fabed59
Removing either one of the two tests makes the other one pass.
The text was updated successfully, but these errors were encountered: