Skip to content

Instantly share code, notes, and snippets.

@GE-N
Created August 12, 2015 07:35
Show Gist options
  • Save GE-N/316d61da01f68394fb4f to your computer and use it in GitHub Desktop.
Save GE-N/316d61da01f68394fb4f to your computer and use it in GitHub Desktop.
BDD#2
import Foundation
import Quick
import Nimble
import OHHTTPStubs
import SMSME
class SMSAPISpec: QuickSpec {
override func spec() {
describe("API") {
context("Send SMS") {
it("should success") {
var sendResult: APIResult?
SMSAPI.sendSMS("0801112222", text: "Hello, world", callback : { result in
result = sendResult
}
expect(sendResult).toNotEventually(beNil())
expect(sendResult?.isSuccess()).toEventually(beTrue())
}
it("should failed") {
var sendResult: APIResult?
SMSAPI.sendSMS("08011122229991123", text: "Hello, fail world", callback : { result in
result = sendResult
}
expect(sendResult).toNotEventually(beNil())
expect(sendResult?.isSuccess()).toEventually(beFalse())
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment