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
4
votes
2 answers

How to unit test api calls using AFNetworking

I have an iOS app I'm working on, which connects to a third-party web service. I have around 50 different calls, and want to write unit tests using Kiwi, but I have no idea where to start. As I'm not responsible for the API, I need to just check…
squarefrog
  • 4,750
  • 4
  • 35
  • 64
4
votes
2 answers

How do I setup Kiwi with Cocoapods?

I am new to both Kiwi and Cocoapods. I have Cocoapods up and running however even before I start playing with Kiwi my testing target fails with errors like this: Undefined symbols for architecture i386: "_CGRectZero", referenced from: …
Steve Moser
  • 7,647
  • 5
  • 55
  • 94
3
votes
0 answers

How do I test categories using Kiwi

I am having problems when using Kiwi to test a dynamically linked framework. The issue is that my objects do not respond to selectors of the functions defined in categories in my dynamically linked framework. I initially thought that this was a…
Dawson
  • 4,391
  • 2
  • 24
  • 33
3
votes
4 answers

Kiwi and CocoaPods with a static shared library

I have a workspace with 3 projects: MyApp Common Pods Common is a common library that MyApp depends on. I'd like to setup CocoaPods and Kiwi to work correctly in this project. How do I go about this? I found…
Liron Yahdav
  • 10,152
  • 8
  • 68
  • 104
3
votes
1 answer

Class comparison, isKindOfClass not working in Kiwi spec

Is there some reason my Kiwi unit tests are failing with these two lines: [[theValue([editAuthorViewController class] == [EditAuthorViewController class]) should] beYes]; [[theValue([editAuthorViewController isKindOfClass:[EditAuthorViewController…
Mike Buss
  • 980
  • 9
  • 25
3
votes
1 answer

Capture arguments of static method calls using Kiwi

This link shows how to capture an argument of a mock object using Kiwi. Is there a way to capture arguments of static method calls? It seems to me that this only work with instance methods.
Raphael Oliveira
  • 7,751
  • 5
  • 47
  • 55
3
votes
1 answer

How to test AFNetworking

*Edit - I originally wanted to test AFNetworking using Nocilla but ended up using OHHTTPStubs to do the job. I've answered the original question below, using OHHTTPStubs * Original Question: I want to test the APIClient of our app - the bare bones…
Octave1
  • 525
  • 4
  • 19
3
votes
2 answers

How to deal with Kiwi? Can't run first tests (Installed via Cocoapods)

I'm trying to run my first Kiwi tests. I use Xcode 5 and Kiwi 2.0 for iOS (installed via Cocoapods). I wrote some tests but when I press 'cmd+u' output in console look like following: Log 2013-09-25 19:17:04.347 KiwiPro[36355:a0b] Cannot find…
Tomasz Szulc
  • 4,217
  • 4
  • 43
  • 79
3
votes
1 answer

How to use kiwi to test the parameters of function call?

I can use the following code to test that cruiser has been called twice. But how to test that the parameter of first call is 7, and the param of second call is 8? id cruiser = [Cruiser cruiser]; [[cruiser should]…
Leo Zhang
  • 3,040
  • 3
  • 24
  • 38
3
votes
1 answer

Strange ordering of Kiwi iOS context blocks

I have a Kiwi spec file that looks something like this: #import "Kiwi.h" #import "MyCollection.h" SPEC_BEGIN(CollectionSpec) describe(@"Collection starting with no objects", ^{ MyCollection *collection = [MyCollection new]; context(@"then…
Barjavel
  • 1,626
  • 3
  • 19
  • 31
3
votes
0 answers

How to test a UICollectionViewLayout with Kiwi?

I need to test a UICollectionViewFlowLayout subclass with Kiwi, I have correctly mocked up the delegate and the dataSource for a UICollectionView, but I'm still having some issues. With the specified item size of CGSize(200.0f, 200.0f), I should be…
Goles
  • 11,599
  • 22
  • 79
  • 140
3
votes
1 answer

Is there a workaround for the lack of a verify method on Kiwi mocks?

I have a strong preference for a highly predictable Arrange Act Assert format for unit tests. Because Kiwi doesn't have an explicit verify statement for mocks, it forces a different pattern, something like: // Arrange Thing *mockThing =…
Cris
  • 1,939
  • 3
  • 23
  • 37
2
votes
2 answers

iOS Testing Mock Subclass With Properties Using Kiwi

I have an application, for which I use Objective Resource to create local objects to reflect remote responses. The specific model classes have subclass an abstract-ish class to give them all a variety of additional functionality, most importantly…
averydev
  • 5,717
  • 2
  • 35
  • 35
2
votes
0 answers

Xcode 7 test fails but shows successful

I am not sure if I am making a mistake or there is a bug. I have setup 2 tests. One of them fails one doesn't but the test suit gets the checkmark. it seems like there has been a similar issue before in Xcode 5 but this was not useful to…
Matt
  • 674
  • 11
  • 25
2
votes
1 answer

XCTest linker error for custom cocoa touch framework

I created a custom cocoa touch framework, the custom touch framework uses Kiwi pod and thus uses XCTest. In my framework target I ensured there are no linker flags for XCTest and I Archived the framework and added that to a new project. In the new…
Vig
  • 1,532
  • 1
  • 12
  • 28
1
2
3
8 9