forked from ReactiveCocoa/ReactiveCocoa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NSControllerRACSupportSpec.m
47 lines (34 loc) · 983 Bytes
/
NSControllerRACSupportSpec.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// NSControllerRACSupportSpec.m
// ReactiveCocoa
//
// Created by Uri Baghin on 26/10/13.
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
//
#import <Quick/Quick.h>
#import <Nimble/Nimble.h>
#import <AppKit/AppKit.h>
#import "RACKVOChannel.h"
@interface RACTestController : NSController
@property (nonatomic, strong) id object;
@end
@implementation RACTestController
@end
QuickSpecBegin(NSControllerRACSupportSpec)
qck_it(@"RACKVOChannel should support NSController", ^{
RACTestController *a = [[RACTestController alloc] init];
RACTestController *b = [[RACTestController alloc] init];
RACChannelTo(a, object) = RACChannelTo(b, object);
expect(a.object).to(beNil());
expect(b.object).to(beNil());
a.object = a;
expect(a.object).to(equal(a));
expect(b.object).to(equal(a));
b.object = b;
expect(a.object).to(equal(b));
expect(b.object).to(equal(b));
a.object = nil;
expect(a.object).to(beNil());
expect(b.object).to(beNil());
});
QuickSpecEnd