Skip to content

Commit

Permalink
fix tests on OSX Xcode5-DP5
Browse files Browse the repository at this point in the history
  • Loading branch information
HBehrens committed Sep 4, 2013
1 parent 2b59d4f commit a522cbd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ tests/objc-ios/documentation
.idea/workspace.xml
.idea/tasks.xml
TransitExampleIOS.xccheckout
TransitTestsOSX.xccheckout
31 changes: 19 additions & 12 deletions tests/objc-general/TransitNativeFunctionTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ @interface TransitNativeFunctionTests : SenTestCase

@end

@implementation TransitNativeFunctionTests
@implementation TransitNativeFunctionTests {
TransitContext *_simpleContext;
}

- (void)setUp {
[super setUp];
_simpleContext = TransitContext.new;
}

- (void)tearDown {
_simpleContext = nil;
[super tearDown];
}

-(void)testWillCallBlock {
id mock = [CCWeakMockProxy mockForProtocol:@protocol(TransitFunctionBodyProtocol)];
Expand All @@ -37,13 +49,8 @@ -(void)testWillCallBlock {
[mock verify];
}

-(id)simpleContext {
TransitContext *context = [[TransitContext alloc] init];
return context;
}

-(void)testJSRepresentation {
TransitFunction *func = [[TransitNativeFunction alloc] initWithContext:[self simpleContext] nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
TransitFunction *func = [[TransitNativeFunction alloc] initWithContext:_simpleContext nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
return (id) nil;
}];

Expand All @@ -55,7 +62,7 @@ -(void)testJSRepresentation {
}

-(void)testJSRepresentationToResolveProxyBlocked {
TransitFunction *func = [[TransitNativeFunction alloc] initWithContext:[self simpleContext] nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
TransitFunction *func = [[TransitNativeFunction alloc] initWithContext:_simpleContext nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
return (id) nil;
}];

Expand All @@ -65,7 +72,7 @@ -(void)testJSRepresentationToResolveProxyBlocked {
}

-(void)testJSRepresentationToResolveProxyAsync {
TransitNativeFunction *func = [[TransitNativeFunction alloc] initWithContext:[self simpleContext] nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
TransitNativeFunction *func = [[TransitNativeFunction alloc] initWithContext:_simpleContext nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
return (id) nil;
}];
func.async = YES;
Expand All @@ -76,7 +83,7 @@ -(void)testJSRepresentationToResolveProxyAsync {
}

-(void)testJSRepresentationToResolveProxyNoThis {
TransitNativeFunction *func = [[TransitNativeFunction alloc] initWithContext:[self simpleContext] nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
TransitNativeFunction *func = [[TransitNativeFunction alloc] initWithContext:_simpleContext nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
return (id) nil;
}];
func.noThis = YES;
Expand All @@ -87,7 +94,7 @@ -(void)testJSRepresentationToResolveProxyNoThis {
}

-(void)testJSRepresentationToResolveProxyAsyncAndNoThis {
TransitNativeFunction *func = [[TransitNativeFunction alloc] initWithContext:[self simpleContext] nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
TransitNativeFunction *func = [[TransitNativeFunction alloc] initWithContext:_simpleContext nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
return (id) nil;
}];
func.async = YES;
Expand All @@ -99,7 +106,7 @@ -(void)testJSRepresentationToResolveProxyAsyncAndNoThis {
}

-(void)testInExpression {
TransitFunction *func = [[TransitNativeFunction alloc] initWithContext:[self simpleContext] nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
TransitFunction *func = [[TransitNativeFunction alloc] initWithContext:_simpleContext nativeId:@"someId" genericBlock:^(TransitNativeFunctionCallScope *scope) {
return (id) nil;
}];

Expand Down

0 comments on commit a522cbd

Please sign in to comment.