Created
February 3, 2014 01:26
-
-
Save robb/8777652 to your computer and use it in GitHub Desktop.
boolean operators for matchers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface FooTests : XCTestCase | |
@end | |
@implementation FooTests | |
- (void)testAnd { | |
expect(@"foo") | |
.to.beKindOfClass(NSString.class) | |
.and.equal(@"foo"); | |
} | |
- (void)testOr { | |
expect(@"foo") | |
.to.equal(@"bar") | |
.or.equal(@"foo"); | |
expect(@"foo") | |
.to.equal(@"foo") | |
.or.equal(@"bar"); | |
expect(@"foo") | |
.to.equal(@"bar") | |
.or.equal(@"foo") | |
.or.equal(@"bar"); | |
} | |
- (void)testOrAndAnd { | |
expect(@"foo") | |
.to | |
.beKindOfClass(NSString.class) | |
.and.equal(@"foo") | |
.or | |
.beKindOfClass(NSNumber.class) | |
.and.equal(@2) | |
.or | |
.beKindOfClass(NSNull.class) | |
.and.equal(NSNull.null); | |
expect(@2) | |
.to | |
.beKindOfClass(NSString.class) | |
.and.equal(@"foo") | |
.or | |
.beKindOfClass(NSNumber.class) | |
.and.equal(@2) | |
.or | |
.beKindOfClass(NSNull.class) | |
.and.equal(NSNull.null); | |
expect(NSNull.null) | |
.to | |
.beKindOfClass(NSString.class) | |
.and.equal(@"foo") | |
.or | |
.beKindOfClass(NSNumber.class) | |
.and.equal(@2) | |
.or | |
.beKindOfClass(NSNull.class) | |
.and.equal(NSNull.null); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment