Questions tagged [kiwi]

Kiwi is a Behavior Driven Development library for iOS development. The goal is to provide a BDD library that is exquisitely simple to setup and use.

Kiwi is a Behavior Driven Development library for iOS development. The goal is to provide a BDD library that is exquisitely simple to setup and use.

It's syntax is inspired from Ruby's unit testing framework Rspec.

126 questions
0
votes
1 answer

Specta 'should receive' code

I'm trying to use Specta as my unit testing framework (Instead of Kiwi). How can I test if an object receives a selector Let's say 5 times, like I do in Kiwi? In other words, what is the equivalent to this 'Kiwi' line of code: [[sut should]…
Avi Tsadok
  • 1,843
  • 13
  • 19
0
votes
1 answer

How to verify didReceiveMemoryWarning function in kiwi bdd test cases?

I'm facing issue to verify did receive memory warning function in by using kiwi test cases. how to verify the function? - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } Any one know about kiwi test case?
Yalamandarao
  • 3,852
  • 3
  • 20
  • 27
0
votes
1 answer

How to write Kiwi test cases in for below mentioned IBAction

I'm facing the issue to right test case for below mentioned function. -(IBAction) returnToLogin:(UIStoryboardSegue*) segue { NSLog(@"kiwi tested"); } I have tried different ways but it's pass the test case it(@"Should unwind segue", ^{ …
Yalamandarao
  • 3,852
  • 3
  • 20
  • 27
0
votes
1 answer

Kiwi tests are not working in xcode 7

I have this code in my xcode7 project: SPEC_BEGIN(TTests) describe(@"Math", ^{ it(@"is pretty cool", ^{ [[theValue(1) should] equal:theValue(1)]; }); }); SPEC_END and I have this error when I run this test: -[TTests…
sasha_nec
  • 532
  • 5
  • 12
0
votes
2 answers

run Kiwi tests on Jenkins with ios-sim

I want to run Kiwi tests for my app, but I'm pretty new to Jenkins so probably I'm missing out something. I installed iOS-sim on the mac that runs Jekins. I run $ ios-sim --version just to make sure it was installed. In my project in the Build…
Mihai Fischer
  • 329
  • 2
  • 11
0
votes
1 answer

How can I wait for my asynchronous Kiwi tests to complete, or run code after they do?

I'm using Kiwi to do some asynchronous testing. One test checks that, after a (stubbed) network request, the response from the network is written to disk. Both the network request and writing the response to disk are done on background…
MaxGabriel
  • 7,617
  • 4
  • 35
  • 82
0
votes
0 answers

Pointer to block pointer

I have a method using promises (PMKPromise), that I'd like to unit test using the library Kiwi. My method looks like this: - (void)fetchData { [PMKPromise new:^(PMKPromiseFulfiller fulfill, PMKPromiseRejecter reject) { // make the…
0
votes
1 answer

Spontaneous failures running Kiwi-based tests on an iOS app when using Realm

I'm working on an app that has a Kiwi test suite with 300+ tests. The tests are being run as application tests, where the main app target is the host for the test bundle. I am trying to add Realm to the app, but when I have Realm objects compiled…
roperklacks
  • 1,081
  • 11
  • 13
0
votes
2 answers

Kiwi spying on multiple NSNotifications

I am currently spying on postNotification like this __block KWCaptureSpy *notificationSpy = [[NSNotificationCenter defaultCenter] captureArgument:@selector(postNotification:) atIndex:0]; The problem is I have multiple notifications with different…
Vig
  • 1,532
  • 1
  • 12
  • 28
0
votes
1 answer

What is a practical example of using Kiwi's KWCaptureSpy?

I'm having trouble understanding what a practical application of using Kiwi's KWCaptureSpy is. I could do something like this and have it pass: __block id successJSON; KWCaptureSpy *successBlockSpy = [HNKServer…
H K
  • 1,215
  • 2
  • 16
  • 29
0
votes
1 answer

Kiwi: concrete difference between mock and nullMock?

I'm using Kiwi on a project and am not quite clear on when to use a mock versus a nullMock. Here is what Kiwi's documentation currently provides: A plain mock object will raise an exception when it receives a selector or message pattern that it…
H K
  • 1,215
  • 2
  • 16
  • 29
0
votes
2 answers

Kiwi BDD - How to test results of `tableView:cellForRowAtIndexPath:`? (Objective-C)

I'm using Kiwi to write tests for an app. I am trying to verify that the cell returned from tableView:cellForRowAtIndexPath: has the correct values set after the call. I've done a unch of different variations of this with no luck: …
H K
  • 1,215
  • 2
  • 16
  • 29
0
votes
1 answer

Block is null when trying Kiwi stubWithBlock:

I'm trying to test that my App behaves correctly based on the success or failure of my API call. when I break point the __block statements, the block is nil (EXC_BAD_ACCESS) When I call the userSuccess block at the bottom, it is also nil. I'm still…
Killian
  • 936
  • 3
  • 14
  • 28
0
votes
1 answer

iOS Testing: Check elements if exists in UIViewController using KIWI

I am using KIWI for testing my iOS app. I would like to ask how to check if element exists in UIViewController, however, I declared the element inside the implementation file and not in header file. Is that possible? #import…
dr.calix
  • 667
  • 8
  • 21
0
votes
1 answer

How do I perform a kiwi unit test, inside a JSON callback?

I am trying to run a kiwi test, it doesn't evaluate the kiwi statement on the inner block. But it will evaluate any test statements outside the block. What do I do? : - (void) jsonTest:(void (^)(NSDictionary *model))jsonData{ …
Tim Nuwin
  • 2,775
  • 2
  • 29
  • 63
1 2 3
8 9