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", ^{
it(@"should equal 2", ^{
[[theValue(1+1) should] equal:theValue(2)];
});
});
});
However, when I attempt to test one of my models, things fall apart.
I include my model's .h file in my spec:
#import "MyModel.h"
And then a whole slew of errors come in when I run my tests.
A few things that I can't figure out:
- As mentioned, I added my testing target to an existing project. How do I share my model class with my new testing target? By simply selecting the .m file in Build Phases/Compile Sources?
- If my model uses other models/helper classes/categories, do I need to share those with the testing target too? And do I need to import all of those files into my spec file as well?
- My model relies on AFNetworking, which I also have installed as a Cocoapod. How can I use that library in my testing target? I've tried simply importing AFNetworking.h but that obviously fails.
Thanks!