Sha256: 7a7dc793a25bac581af961740aaee497a149197f5414a43afe0b740fb818c5f9

Contents?: true

Size: 1.31 KB

Versions: 8

Compression:

Stored size: 1.31 KB

Contents

#import "EXPMatchers+beInTheRangeOf.h"
#import "EXPMatcherHelpers.h"

EXPMatcherImplementationBegin(_beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)) {
    match(^BOOL{
        if ([actual respondsToSelector:@selector(compare:)]) {
            NSComparisonResult compareLowerBound = [expectedLowerBound compare: actual];
            NSComparisonResult compareUpperBound = [expectedUpperBound compare: actual];
            if (compareLowerBound == NSOrderedSame) {
                return YES;
            }
            if (compareUpperBound == NSOrderedSame) {
                return YES;
            }
            if ((compareLowerBound == NSOrderedAscending) && (compareUpperBound == NSOrderedDescending)) {
                return YES;
            }
        }
        return NO;
    });

    failureMessageForTo(^NSString *{
        return [NSString stringWithFormat:@"expected: %@ to be in the range [%@, %@] (inclusive)", EXPDescribeObject(actual), EXPDescribeObject(expectedLowerBound), EXPDescribeObject(expectedUpperBound)];
    });

    failureMessageForNotTo(^NSString *{
        return [NSString stringWithFormat:@"expected: %@ not to be in the range [%@, %@] (inclusive)", EXPDescribeObject(actual), EXPDescribeObject(expectedLowerBound), EXPDescribeObject(expectedUpperBound)];
    });
}
EXPMatcherImplementationEnd

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
second_curtain-0.6.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m
second_curtain-0.5.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m
second_curtain-0.4.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m
second_curtain-0.3.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m
cocoapods-deintegrate-0.2.1 spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m
cocoapods-deintegrate-0.2.0 spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m
second_curtain-0.2.4 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m
second_curtain-0.2.3 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m