quick-nimble

Quick/Nimble notification userInfo testing

廉价感情. 提交于 2020-12-10 15:59:49
问题 I was looking at the notifications support in quick/nimble, e.g.: expect { NotificationCenter.default.postNotification(testNotification) }.to(postNotifications(equal([testNotification])) Is there a way to get my hands on the notification that is returned to inspect the userInfo? My goal is to invoke a method that posts a notification, and then inspect that notification userInfo and make sure that the key/value pairs are correct. Quick: 2.1.0 Nimble: 8.0.1 回答1: I ended up doing this: func

Quick/Nimble notification userInfo testing

匆匆过客 提交于 2020-12-10 15:58:48
问题 I was looking at the notifications support in quick/nimble, e.g.: expect { NotificationCenter.default.postNotification(testNotification) }.to(postNotifications(equal([testNotification])) Is there a way to get my hands on the notification that is returned to inspect the userInfo? My goal is to invoke a method that posts a notification, and then inspect that notification userInfo and make sure that the key/value pairs are correct. Quick: 2.1.0 Nimble: 8.0.1 回答1: I ended up doing this: func

How to reliably install and setup Quick test framework on Xcode 8?

牧云@^-^@ 提交于 2019-12-24 07:11:56
问题 Background : While working on this answer I noticed that it's not so trivial to properly set up Quick test framework on Xcode properly. In my case, it took 3-4 failed attempts to finally have a working version. And still, I'm not sure where my previous attempts were wrong. Or more importantly why the questioner in that thread could have duplicate run each time. Then it also took him several attempts to finally have a working one. Question : I am asking if any of you have a reliable way to set

Why are the before- and afterEach blocks called multiple times in unit-testing with Quick?

一笑奈何 提交于 2019-12-10 13:15:20
问题 I wrote a test case with some example groups including beforeEach and afterEach . And I expected that each beforeEach and afterEach would be called once for each it . Alas, for a single it the beforeEach and afterEach got called multiple times. I've looked at some documentation (i.e. Quick's own documentation and http://jasmine.github.io/2.1/introduction.html), but those don't help my cause. Here is a small snippet that demonstrates this: class CheckerTests: QuickSpec { override func spec() {