Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 48 lines (36 sloc) 0.943 kb
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 48
//
// KWBeNotNilMatcher.m
// Kiwi
//
// Created by Luke Redpath on 17/01/2011.
// Copyright 2011 Allen Ding. All rights reserved.
//

#import "KWBeNonNilMatcher.h"
#import "KWFormatter.h"

@implementation KWBeNonNilMatcher

#pragma mark -
#pragma mark Getting Matcher Strings

+ (NSArray *)matcherStrings {
  return [NSArray arrayWithObjects:@"beNonNil", nil];
}

#pragma mark -
#pragma mark Matching

- (BOOL)evaluate {
  return (BOOL)(self.subject != nil);
}

#pragma mark -
#pragma mark Getting Failure Messages

- (NSString *)failureMessageForShould {
  return [NSString stringWithFormat:@"expected subject to be non-nil, got %@",
          [KWFormatter formatObject:self.subject]];
}

- (NSString *)failureMessageForShouldNot {
  return [NSString stringWithFormat:@"expected %@ not to be non-nil",
          [KWFormatter formatObject:self.subject]];
}

- (NSString *)description
{
  return @"be non-nil";
}

- (void)beNonNil {}

@end
Something went wrong with that request. Please try again.