Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 61 lines (38 sloc) 1.89 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 49 50 51 52 53 54 55 56 57 58 59 60
//
// NSObject+Shoulda.h
//
// Created by Saul Mora on 3/11/10.
// Copyright 2010 Magical Panda Software, LLC All rights reserved.
//

#import "ObjectiveShoulda.h"

@interface NSObject (Shoulda)

+ (void) object:(id)actual shouldBe:(id)expected withDescription:(NSString *)reason;
+ (void) object:(id)actual shouldNotBe:(id)expected withDescription:(NSString *)reason;

- (void) shouldBeNilWithDescription:(NSString *)reason;
- (void) shouldNotBeNilWithDescription:(NSString *)reason;

- (void) shouldBeTrueWithDescription:(NSString *)reason;
- (void) shouldBeFalseWithDescription:(NSString *)reason;

- (void) shouldBeEqualTo:(id)expected withDescription:(NSString *)reason;
- (void) shouldNotBeEqualTo:(id)expected withDescription:(NSString *)reason;

- (void) shouldThrowException:(NSException *)expectedException withDescription:(NSString *)reason;
- (void) shouldThrowExceptionNamed:(NSString *)exceptionName withDescription:(NSString *)reason;

- (void) shouldRespondToSelector:(SEL)expectedSelector withDescription:(NSString *)reason;
- (void) shouldNotRespondToSelector:(SEL)selector withDescription:(NSString *)reason;

+ (void) shouldImplementProtocol:(Protocol *)expectedProtocol withDescription:(NSString *)reason;

@end

@interface NSObject (SimpleShoulda)

+ (void) shouldBeNil:(id)actual;
+ (void) shouldNotBeNil:(id)actual;

+ (void) object:(id)actual shouldBe:(id)expected;
+ (void) object:(id)actual shouldNotBe:(id)expected;

- (void) shouldBeNil;
- (void) shouldNotBeNil;

- (void) shouldBeTrue;
- (void) shouldBeFalse;

- (void) shouldBeEqualTo:(id)expected;


- (void) shouldThrowException:(NSException *)expectedException;
- (void) shouldThrowExceptionNamed:(NSString *)exceptionName;

- (void) shouldRespondToSelector:(SEL)expectedSelector;
- (void) shouldNotRespondToSelector:(SEL)selector;

+ (void) shouldImplementProtocol:(Protocol *)expectedProtocol;

@end

Something went wrong with that request. Please try again.