replace `rescue exceptions` to `assert_raises exceptions`