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
1
vote
1 answer

Using ReactiveCocoa, Kiwi, and Cocoapods together, getting "is not a tuple" exception

I'm trying to get a new project set up using ReactiveCocoa and Kiwi for testing, using CocoaPods for dependency management. I have a first test set up for a typical login screen, where the login button isn't enabled until the user has input…
dpassage
  • 5,423
  • 3
  • 25
  • 53
1
vote
1 answer

Avoiding fragile unit tests with NSDateFormatter

What is the best practice for testing NSDateFormatter methods? For example, lets say I have a method: - (NSString *)formatStringFromDate:(NSDate *)date { NSDateFormatter *f = [[NSDateFormatter alloc] init]; [f…
squarefrog
  • 4,750
  • 4
  • 35
  • 64
1
vote
2 answers

Stub Method and Dynamically Set its Return Value to an Input Parameter

I'd like to dynamically return a value dependent of a parameter to a mocked method, conceptionally like this: [realObject stub] myMethod:CAPTUREDARGUMENT) andReturn:myMethod:CAPTUREDARGUMENT]; Or access the invocation in a block like with…
fabb
  • 11,660
  • 13
  • 67
  • 111
1
vote
2 answers

Unit testing problems and crashing with XCode 5 and Kiwi/XCUnit

I'm having many issues with unit testing in XCode 5 and want to verify if anybody else if having the same problems (and any possible solutions...) I'm using the Kiwi framework developing for ios7 and its a new project therefore is using XCUnit…
Michael
  • 2,258
  • 1
  • 23
  • 31
1
vote
0 answers

Xcode test mark for kiwi

In Xcode, is there a way to show a test mark in front of line number (like that we see at SPEC_BEGIN line) for other command such as "context", "describe" or "it"?
Warut Surapat
  • 503
  • 6
  • 12
1
vote
1 answer

getting BAD_EXCESS during kiwi testing,

I am working on kiwi framework for testing by following myStack.m - (id) init { if (self = [super init]) { _data = [[NSMutableArray alloc] initWithCapacity:4]; } return self; } - (void) push:(int)numberToPush { [self.data…
tranvutuan
  • 6,089
  • 8
  • 47
  • 83
1
vote
1 answer

Unable to stub timestamp on a mock CLLocation object in Kiwi

I'm writing some tests, where I need to stub a call to a mock CLLocationManager to return a particular CLLocation and in turn that CLLocation needs to have a timestamp that is in the past Creating instances of CLLocation is easy enough, but the…
1
vote
0 answers

Testing a AFNetworking API with Kiwi

I'm writing some tests for a networking API with kiwi. Here is the relevant code: ////////////////////////////////////////////////////// MyAPI.h ////////////////////////////////////////////////////// @protocol MyAPIDelegate -(void)…
dornad
  • 1,274
  • 3
  • 17
  • 36
1
vote
2 answers

Is it possible to instantiate a View Controller from a Storyboard for Kiwi Testing

I'm in for testing some code within a ViewController (that certain controls are active depending on the state of certain UISwitches etc) and decided to go for Kiwi for it, since we are using it for some other low-level logic testing. My expectation…
Katagelon
  • 11
  • 2
1
vote
1 answer

Kiwi - Expected subject to be nil, got KWAsyncVerifier

I'm using Kiwi to write the tests for my app. I wrote tests to test against my API. I was guided by this example in the documentation for testing asynchronous calls: https://github.com/allending/Kiwi/wiki/Asynchronous-Testing My tests are long, so…
Kex
  • 776
  • 10
  • 22
1
vote
0 answers

Setting up kiwi for multiple target

I have a xcode project that has 2 targets for iPad and iPhone build. I have followed the installation instructions and installed kiwi via cocoapods. When I create a new test target "Product Name", xcode created a folder group and it comes with…
Nora Olsen
  • 983
  • 2
  • 10
  • 22
1
vote
1 answer

Why kiwi matcher raises exception when matching?

I have implemented example from Mocking Network Requests With OHHTTPStubs. Unfotunately I encountered EXC_BAD_ACCESS exception when matching my result in line: [[expectFutureValue(origin) shouldEventuallyBeforeTimingOutAfter(3.0)]…
pro_metedor
  • 1,176
  • 10
  • 17
1
vote
1 answer

afhttpclient unit testing changes in network reachability

The current implementation I have is an AFHTTPClient subclass and accompanying manager class that handles the connection with an API. As the app will be used in places where network connectivity can't be guaranteed, I'm wanting to write some unit…
Matt Delves
  • 1,585
  • 2
  • 13
  • 19
1
vote
1 answer

Kiwi test target using Cocoapods

I've added Kiwi via Cocoapods. This is the content of the podfile platform :ios, '5.0' pod 'BlocksKit' pod 'ViewUtils' pod 'AwesomeMenu' target :KiwiUnitTest, :exclusive => true do pod 'Kiwi' end I can run the app without problems. But if I…
zeiteisen
  • 7,078
  • 5
  • 50
  • 68
1
vote
1 answer

Setting up Kiwi with existing project + cocoapod dependencies

I successfully added the Kiwi testing framework to my existing project using Cocoapods. target :KiwiUnitTest do pod 'Kiwi' end I can create a very basic test and have it pass: describe(@"A simple test", ^{ context(@"when adding 1 + 1", ^{ …
djibouti33
  • 12,102
  • 9
  • 83
  • 116
1 2 3
8 9