Skip to content

Instantly share code, notes, and snippets.

@enomoto
Last active January 30, 2019 04:17
Show Gist options
  • Save enomoto/cf23cfac80557c9e4aa77173714565d1 to your computer and use it in GitHub Desktop.
Save enomoto/cf23cfac80557c9e4aa77173714565d1 to your computer and use it in GitHub Desktop.
import Foundation
@testable import Foobar
import Quick
import Nimble
import Mockingjay
import APIKit
final class FooRequestSpec: QuickSpec {
override func spec() {
describe("FooRequest") {
context("正常系") {
let request = FooRequest()
var sut: FooStatus!
beforeEach {
waitUntil { done in
self.stub(uri: "/foo", status: 200, with: "foo") // ここでスタブする
MySession.send(request) { result in
switch result {
case .success(let response):
sut = response
case .failure: break
}
done()
}
}
}
it("取得結果が期待値と同じであること") {
expect(sut.id).to(equal(1))
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment