Roc*_*den 5 swift quick-nimble
我在测试一个抛出异常的方法时让Nimble匹配器正确无误.根据文档,它应该很简单.我只需要这样的期望
expect( try somethingThatThrows() ).toNot( throwError() )
Run Code Online (Sandbox Code Playgroud)
但是对于Swift 3和Xcode 8.2,我得到了一个编译器编辑器.这是上下文.
describe("Using RealmDatasource") {
let datastore = RealmDatasource() as Datasource
it("can retrieve an object") {
expect( try datastore.getCurrentObject() ).to( throwError() )
}
}
Run Code Online (Sandbox Code Playgroud)
我在'it'声明行上收到以下错误
Run Code Online (Sandbox Code Playgroud)Invalid conversion from throwing function of type '() -> () throws to non-throwing function of type '() -> ()'
| 归档时间: |
|
| 查看次数: |
957 次 |
| 最近记录: |