Use assert_raise
to test if an exception was raised. assert_raise
takes in an Exception
and a function to be executed.
As you can see, you can wrap any code you want to test in an anonymous function and pass it to assert_raise
.
Use assert_raise
to test if an exception was raised. assert_raise
takes in an Exception
and a function to be executed.
As you can see, you can wrap any code you want to test in an anonymous function and pass it to assert_raise
.