-
-
Notifications
You must be signed in to change notification settings - Fork 602
/
ObjCBeFalseTest.m
46 lines (35 loc) · 1.08 KB
/
ObjCBeFalseTest.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
#import <XCTest/XCTest.h>
#import "NimbleSpecHelper.h"
@interface ObjCBeFalseTest : XCTestCase
@end
@implementation ObjCBeFalseTest
- (void)testPositiveMatches {
expect(@NO).to(beFalse());
expect(@YES).toNot(beFalse());
expect(false).to(beFalse());
expect(true).toNot(beFalse());
expect(NO).to(beFalse());
expect(YES).toNot(beFalse());
expect(10).toNot(beFalse());
}
- (void)testNegativeMatches {
expectNilFailureMessage(@"expected to be false, got <nil>", ^{
expect(nil).to(beFalse());
});
expectNilFailureMessage(@"expected to not be false, got <nil>", ^{
expect(nil).toNot(beFalse());
});
expectFailureMessage(@"expected to be false, got <1>", ^{
expect(true).to(beFalse());
});
expectFailureMessage(@"expected to not be false, got <0>", ^{
expect(false).toNot(beFalse());
});
expectFailureMessage(@"expected to be false, got <1>", ^{
expect(YES).to(beFalse());
});
expectFailureMessage(@"expected to not be false, got <0>", ^{
expect(NO).toNot(beFalse());
});
}
@end