Refactoring exception test.

Change to use assert_equal explicitly.