зеркало из https://github.com/github/Rebel.git
Style fixes.
This commit is contained in:
Родитель
c35ab2e75e
Коммит
fd55f3569a
|
@ -21,8 +21,7 @@
|
|||
}
|
||||
|
||||
- (void (^)(BOOL))rbl_completionBlock {
|
||||
NSAssert([self.delegate isKindOfClass:[RBLCAAnimationDelegate class]],
|
||||
@"Wrong delegate for the animation. Expected %@, but instead got %@.", [RBLCAAnimationDelegate class], [self.delegate class]);
|
||||
NSAssert([self.delegate isKindOfClass:RBLCAAnimationDelegate.class], @"Wrong delegate for animation %@. Expected %@, but instead got %@.", self, RBLCAAnimationDelegate.class, [self.delegate class]);
|
||||
return [(RBLCAAnimationDelegate *)self.delegate completion];
|
||||
}
|
||||
|
||||
|
|
|
@ -36,18 +36,14 @@ it(@"should should fire once animation is completed", ^{
|
|||
CALayer *layer = [CALayer layer];
|
||||
CABasicAnimation *sampleAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
|
||||
__block BOOL fired = NO;
|
||||
[sampleAnimation setRbl_completionBlock:^(BOOL complete) {
|
||||
sampleAnimation.rbl_completionBlock = ^(BOOL complete) {
|
||||
fired = YES;
|
||||
}];
|
||||
|
||||
};
|
||||
sampleAnimation.duration = 0.0;
|
||||
[layer addAnimation:sampleAnimation forKey:@"opacity"];
|
||||
layer.opacity = 1.f;
|
||||
|
||||
NSDate *runUntil = [NSDate dateWithTimeIntervalSinceNow:0.1];
|
||||
while (!fired && [runUntil timeIntervalSinceNow] > 0) {
|
||||
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:runUntil];
|
||||
}
|
||||
expect(fired).to.beTruthy();
|
||||
expect(fired).will.beTruthy();
|
||||
});
|
||||
|
||||
SpecEnd
|
||||
|
|
Загрузка…
Ссылка в новой задаче