我正在尝试使用 Cedar 测试控制器,但无法真正理解为什么它不起作用。控制器永远不会被显示,viewDidLoad 或 viewDidAppear 永远不会被调用。这是雪松不应该做的事情还是只是我的错误?
describe(@"MyController", ^{
__block UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
__block UINavigationController *root = (UINavigationController *)[[[[UIApplication sharedApplication] delegate]window ]rootViewController];
__block MyViewController *model = [storyboard instantiateViewControllerWithIdentifier:@"MyController"];
[root pushViewController:model animated:YES];
it(@"should test something", ^{
expect(model.content).to(be_truthy);
});
});