Use hspec's shouldThrow

Improve test cases that expect an exception to be thrown.