2
例外をスローするメソッドをテストする際にNimbleマッチャーを正しく取得できません。ドキュメントによれば、それは単純でなければならない。Nimbleでクイックでエラーをスローするメソッドをテスト中にエラーが発生しました
expect(try somethingThatThrows()).toNot(throwError())
ただし、Swift 3とXcode 8.2ではコンパイラエディタが表示されています。ここに文脈があります。
describe("Using RealmDatasource") {
let datastore = RealmDatasource() as Datasource
it("can retrieve an object") {
expect(try datastore.getCurrentObject()).to(throwError())
}
}
は私が
Invalid conversion from throwing function of type '() ->() throws to non-throwing function of type '() ->()'