Last active
January 30, 2019 04:17
-
-
Save enomoto/cf23cfac80557c9e4aa77173714565d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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