I wanna do a test on a method call similar to:
call_to_method_1 param1
this method can raise for example:
raise msg1 if ...
raise msg2 if ...
My question is How to test exception with its msg1, msg2 exception messages wtih RSpec.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if you
raise "message"then theExceptionClasswill be instance ofRuntimeClass.IMO it’s better to raise specific type of exception instead of relying on message though.