【发布时间】:2012-09-21 01:27:32
【问题描述】:
我想显示 Scala 测试中抛出的异常消息。
" iWillThrowCustomException Method Failure test.
" should "Fail, Reason: Reason for failing. " in {
evaluating {
iWillThrowCustomException();
} should produce [CustomException]
}
如果 CustomExeption 会针对不同的输入抛出不同类型的消息,比如说
(对于 -ve 金额 - 金额小于零,对于金额中的字符 - 无效金额),
如何显示在块中抛出的消息,因为它会通过 CustomException ,它会显示测试成功,但它已经抛出了错误
【问题讨论】:
标签: scala