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

Mapping between kiwi specs and BDD terms

Was just trying to wrap my head around how a BDD Story-scenario-Given-when-then maps to Kiwi's describe-context-it as a general rule of thumb if that is possible.. just to get a feel of what should go where when writing tests
inforeqd
  • 3,209
  • 6
  • 32
  • 46
0
votes
1 answer

How to spy on a class method in Kiwi?

I've looked through various examples with class mocking, like these: https://groups.google.com/forum/#!topic/kiwi-bdd/hrR2Om3Hv3I https://gist.github.com/sgleadow/4029858 Mocking expectations in Kiwi (iOS) for a delegate The class Test has a class…
Dumoko
  • 2,614
  • 3
  • 25
  • 34
0
votes
1 answer

Can't run Kiwi tests (XCTest) in xcodebuild (Xcode 6)

I'm trying to run my tests using the CLI tools. After following various guides, I came up with this command: xcodebuild -workspace myworkspace.xcworkspace -scheme testsScheme -sdk iphonesimulator -arch i386 -configuration Debug TEST_AFTER_BUILD=YES…
ShayDavidson
  • 717
  • 1
  • 7
  • 20
0
votes
1 answer

Capturing blocks from method parameters in Kiwi?

I'm working with the Firebase iOS SDK, and I'm struggling to figure out how to fully-test some of the Firebase method calls using Kiwi. I'm using an instance of Firebase to "watch" a path: Firebase *streamsReference = [self.firebaseRef…
TimD
  • 8,014
  • 2
  • 24
  • 34
0
votes
1 answer

UICollectionViewCell subviews not being updated on unit test

I have a test where I want to load a UICollectionViewCell (CustomCollectionViewCell), pass some data to it and check if the labels of the cell are updated with this data. cell.nameLabel is a UILabel of the cell and the method setText is called but…
Renato Rodrigues
  • 1,038
  • 1
  • 18
  • 35
0
votes
1 answer

Kiwi stub and return issue

I want to test the creation of my object using Kiwi. Consider construction like this id objectOne = [ObjectOne objectWithAnotherObject:objectTwo]; Inside of this static method I set up my objectOne from objectTwo, which has defined enum/type…
deathhorse
  • 637
  • 6
  • 15
0
votes
1 answer

How to unstub a method using Kiwi

I have a macro for test purposes that creates a navigation controller, sets it as the root view controller of the main window and put the view controller being tested inside the navigation controller. I also would like to for every invocation of…
Raphael Oliveira
  • 7,751
  • 5
  • 47
  • 55
0
votes
1 answer

Clear stubs on class method in Kiwi

I would like to test method, that reads and writes value from NSUserDefaults. Here is how read method looks like: + (NSDate *)initialImportDate { return [[NSUserDefaults standardUserDefaults] objectForKey:STBInitialImportDateKey]; } I want to…
Gurnetko
  • 76
  • 4
0
votes
1 answer

When testing Objective-C with Kiwi, how do you explicitly remove a stub?

I'm trying to test a value that I also stub like so: context(@"when pressing the audio alert button", ^{ context(@"when audio is currently disabled", ^{ beforeEach(^{ [subject.defaults stub:@selector(boolForKey:)…
abc123
  • 8,043
  • 7
  • 49
  • 80
0
votes
2 answers

In iOS, how can I stub Google Analytics SDK's [GAI sharedInstance] using Kiwi?

I'm using Kiwi for tests and when I try to stub the class method [GAI sharedInstance], it doesn't work. Here is what I'm doing: NSObject *gaiMock = [KWMock nullMock]; [GAI stub:@selector(sharedInstance) andReturn:gaiMock]; When I break after these…
abc123
  • 8,043
  • 7
  • 49
  • 80
0
votes
1 answer

Kiwi File Not Found Error in Xcode

I'm getting this error with Kiwi, installed via CocoaPods, while trying to run tests: ld: file not found:…
Nick Coelius
  • 4,668
  • 3
  • 24
  • 30
0
votes
1 answer

I would like to know what #include do?

I have this library vesSharedPtr.h which includes the following code: #ifndef VESSHAREDPTR_H #define VESSHAREDPTR_H // C/C++ includes #include < tr1/memory > #define vesSharedPtr std::tr1::shared_ptr #define vesWeakPtr std::tr1::weak_ptr #endif…
0
votes
1 answer

iOS Kiwi + Nocilla - Failing to stub request

I'm just starting out with stubbing requests to test async calls to an external API with iOS. I'm currently stuck with the following code and I can't figure out what's not working. The very simple thing I'm trying to achieve is that if I get a 200…
Mike
  • 63
  • 1
  • 7
0
votes
2 answers

Testing background save of Core Data entity with Kiwi

I'm struggling to figure out the best method to test interacting with Core Data in a background thread. I have the following class method: + (void)fetchSomeJSON { // Download some json then parse it in the block [[AFHTTPClient sharedClient]…
squarefrog
  • 4,750
  • 4
  • 35
  • 64
0
votes
1 answer

Kiwi: Is there a way to have a dynamic number of example, defined by a runtime variable?

I'm looking for a way to test properties of nested objects. In essence, I have a spec the will verify the result we get back from an external service. Since I don't want to make a gazillion calls to the service for each example I want to test, the…
Inferis
  • 4,582
  • 5
  • 37
  • 47
1 2 3
8
9