Merge pull request #344 from realm/sk-ios-93-fix

Fix disabling of RCTDevMenu for tests on iOS 9.3
This commit is contained in:
Scott Kyle 2016-03-22 14:40:08 -07:00
commit 08fa6ba90c

View File

@ -34,18 +34,31 @@ extern NSMutableArray *RCTGetModuleClasses(void);
- (void)setUp;
@end
@interface RCTDevMenuDisabler : RCTDevMenu
@end
@interface RealmReactTests : RealmJSTests
@end
@interface RealmReactChromeTests : RealmReactTests
@end
@implementation RCTDevMenuDisabler
+ (void)load {
// +[RCTDevMenu load] is guaranteed to have been called since it's the superclass.
// We remove it since it interferes with us fully controlling the executor class.
NSMutableArray *moduleClasses = RCTGetModuleClasses();
[moduleClasses removeObject:[RCTDevMenu class]];
}
@end
@implementation RealmReactTests
+ (void)load {
NSMutableArray *moduleClasses = RCTGetModuleClasses();
[moduleClasses removeObject:[RCTDevMenu class]];
RCTAddLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
NSAssert(level < RCTLogLevelError, RCTFormatLog(nil, level, fileName, lineNumber, message));
});
@ -224,6 +237,7 @@ extern NSMutableArray *RCTGetModuleClasses(void);
@end
@implementation RealmReactChromeTests
+ (Class)executorClass {