libPods.a, +[BlockAlertView initialize] and logic tests #46

Closed
boecko opened this Issue Apr 22, 2013 · 1 comment

Projects

None yet

1 participant

@boecko

My unit-test gets a __HALT signal, because of the UIFont-Loading in +[BlockAlertView initialize].
NOTE: I'm not using any UIKIT-Classes in my unit-tests. This happens because i'm linking with libPods.a.

My ugly workarround is:

+ (void)initialize
{ 
....
        BOOL senTestingKit = NO;
        NSArray *callStack = [NSThread callStackSymbols];
        for (NSString *call in callStack) {
            NSRange range = [call rangeOfString:@"SenTestingKit"];
            if(range.location != NSNotFound) {
                senTestingKit = YES;
                break;
            }
        }
        if(!senTestingKit) {
            titleFont = [kAlertViewTitleFont retain];
            messageFont = [kAlertViewMessageFont retain];
            buttonFont = [kAlertViewButtonFont retain];
        }
...
@boecko

My bad ...
should have made a

target :test, :exclusive => true do
    ... pods required for test ...
end

entry, without 'BlockAlertsAnd-ActionSheets'.

Anyway .. this entry is good for documention purposes, if someone has the same problem ;)

@boecko boecko closed this Apr 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment