Refactoring exception test.

Change to use assert_equal explicitly.
Merge pull request #2191 from yui-knk/refactor-exc-test

Refactoring exception test.