Use generic error in test to support Ruby <2.0