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

Any good example projects for the Kiwi testing library (offering more complexity than 2+2)

I'm looking for a good example project/tutorial that show the Kiwi testing framework in action. I don't need any more examples of testing classes with the only purpose of adding 2 numbers together or something mundane like that. There are plenty of…
Christian Schlensker
  • 21,708
  • 19
  • 73
  • 121
15
votes
2 answers

platform of the target `fubarTests` (iOS 4.3) is not compatible with `Kiwi (2.2.1)` which has a minimum requirement of iOS 5.0

I can't seem to get past this error and don't know why. I'm running xcode 4.6.3 The project's ios deployment target says iOS 6.1 the base sdk is 6.1 My Podfile is: # Podfile platform :ios target :fubarTests, :exclusive => true do pod 'Kiwi' end…
user2712765
  • 161
  • 1
  • 3
14
votes
3 answers

Helper functions in Kiwi specs

I have a few repetitive specs that I would like to DRY up. The common functionality doesn't lend itself to moving into a beforeEach block. Essentially, it's object creation and is 4 lines for each of 12 objects, I'd like to turn those 4 lines into…
Otto
  • 18,761
  • 15
  • 56
  • 62
10
votes
2 answers

Can't use Kiwi to test with frameworks added by CocoaPods

I'm having an issue getting the testing framework Kiwi to work with frameworks added through CocoaPods. I have both AFNetworking and Lumberjack being loaded in, and both are causing a failure in the test. The test only fails if any source files in…
James Richard
  • 1,525
  • 12
  • 18
9
votes
5 answers

Cannot run tests on Xcode 6 Beta 5

I have an iOS project that is using the Kiwi testing framework (latest version 2.3.0 which I installed from cocoapods). At first when I ran the tests I received an error that it cannot find XCTest.h. So I followed the advice on this answer:…
ifeins
  • 869
  • 1
  • 9
  • 20
7
votes
2 answers

Unable to run Kiwi tests on iOS8 device

I am trying to run Kiwi (installed via CocoaPods) tests on iOS8 device but the build fails with the following linking errors: ld: warning: ignoring file…
juhan_h
  • 3,965
  • 4
  • 29
  • 35
7
votes
1 answer

How to stub method block in Kiwi?

I want to stub a method which takes a block as a parameter using Kiwi. Here is the full explanation with code: I have a class named TestedClass which has a method testedMethod which dependent on class NetworkClass which calls via AFNetworking to a…
kernix
  • 7,970
  • 3
  • 28
  • 44
6
votes
1 answer

How does one unit test code that interacts with the Core Bluetooth APIs?

I would like to unit test a class that acts as a CBPeripheralManagerDelegate to the CBPeripheralManager class. Typically, in order to stub out an external class dependency, I would use either a form of dependency injection by passing in via the…
Michael McGuire
  • 3,770
  • 2
  • 29
  • 28
5
votes
2 answers

How to test delegates asynchronously with Kiwi

H guys, I have been trying for ages to find some good examples on how to use Kiwi testing to test delegate methods, asynchronously. I have a manager class that defines the protocols for testing, with a pass and fail method returned in the delegate.…
Doz
  • 7,009
  • 12
  • 61
  • 69
5
votes
1 answer

Mocking expectations in Kiwi (iOS) for a delegate

Short version of the question: What is wrong with the following Kiwi/iOS mock expectation? [[mockDelegate should] receive:@selector(connectionDidSucceedWithText:andStatus:) withArguments:[testString1…
Sunkas
  • 9,542
  • 6
  • 62
  • 102
4
votes
2 answers

Get result of testing using Kiwi

I would like to post the results of tests for my iPhone app to my TestLink using XML-RPC. I use Kiwi in my project, and now I want to get the results of tests. Can I know whether the conditions on my testcase passed of failed?
fish potato
  • 5,319
  • 6
  • 27
  • 32
4
votes
0 answers

An error About Kiwi unit test

I am learning unit test.I am going to use Kiwi framework.I wrote a simple test code using Kiwi blow: #import SPEC_BEGIN(SimpleStringSpec) describe(@"SimpleString", ^{ context(@"when assigned to 'Hello world'", ^{ NSString…
4
votes
1 answer

Running a single KIWI spec with xctool

Has anyone been able to successfully pass the KW_SPEC variable to xctool. I'm trying to run a single KIWI spec by using https://github.com/kiwi-bdd/Kiwi/wiki/Kiwi-FAQ#q-how-do-i-run-a-single-spec-describecontextit. I can run all the tests…
4
votes
1 answer

Global helper for Kiwi specs

I've defined some helper blocks within the BEGIN_SPEC END_SPEC block in my spec file that I reuse quite often. E.g. asserting that a certain dialog shows up: void (^expectOkAlert) (NSString *, NSString *) = ^void(NSString *expectedTitle, NSString…
mikrobi
  • 291
  • 1
  • 3
  • 11
4
votes
1 answer

Examining a method argument on a mock object with Kiwi

I need help with the following: I'm writing some BDD tests for an client API with the following structure: @protocol MyAPIClientDelegate -(void)myCallbackMethod:(id)response; @end // BEGIN:…
dornad
  • 1,274
  • 3
  • 17
  • 36
1
2 3
8 9