Recently I came across a spec that didn’t seem to be executing the assertion block passed in to the raise_error expectation. Leaving the bare essentials for the example:
1 2 3 4 5 6 7 8 9
We raise an exception, assert that it was raised and the try to assert something about the exception. In this example,
1.should == 2 should clearly fail. However, when we run this:
1 2 3 4
It would seem that the block is never being executed.