Closed Banzuofan closed 9 years ago
You're forgetting the parenthesis after the beNil
(yes, it's troubling that the code compiles without them), so your spec probably terminates early before the callback is being called.
Try with:
expect(reponseData).willNot.beNil();
expect(error).will.beNil();
Thanks for your replies, @StatusReport it works as your codes, i feel so shame for my carelessness
I am writing async test codes as the guide at https://github.com/specta/expecta, but i met a question, when run the test method, it seems that codes in callback block didn't run, i don't know what happen to my code, or something i missed. my code as follow:
When I used XCTest to test my codes, it can run the codes in callback block, and i can see logs in console. I refered to AFNetworking demo containing expecta when i wrote my test codes. Hope you can understand what I said!