I'm new to Objective-C and XCode and consider me mentally challenged when discussing compiled languages in general. I have no idea how linkers work and the amount of build settings in every IDE I've had the discomfort of working with simply scares me.
I've started learning ObjC a few days ago and of course I started with a Console Application project. Everything is fine so far, but I have a Ruby / Rails background which made me want to immediately understand how to set up even the most basic TDD environment in XCode5.
I used this official dev doc but it's less than thorough. Taking the trial and error path I simply added a XCTest target to the Project and then added a Test Case Class, testing my Fraction
class:
#import <XCTest/XCTest.h>
#import "Fraction.h"
@interface FractionTest : XCTestCase
@end
@implementation FractionTest
- (void)setUp
{
[super setUp];
}
- (void)tearDown
{
[super tearDown];
}
- (void)testExample
{
Fraction *fraction = [Fraction new];
}
@end
When running tests the linker can't find referenced symbols:
I've read about setting up Bundle Loaders and Test Host, but nobody truly explains which target they should be set on. They don't work for me and I'm wondering if such a simple, 3-file large "project" even needs tweaking around the Build Settings.
How can I simply add a Test Class that will test another class with simple assertions?