Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Commit

Permalink
make tests work again
Browse files Browse the repository at this point in the history
- put OCHamcrest and OCMockito (with my modifications) in Frameworks
  folger
  • Loading branch information
Tae Won Ha committed Jan 10, 2014
1 parent 808c361 commit 9b1bd6e
Show file tree
Hide file tree
Showing 94 changed files with 4,617 additions and 27 deletions.
1 change: 1 addition & 0 deletions Frameworks/OCHamcrest.framework/Headers
1 change: 1 addition & 0 deletions Frameworks/OCHamcrest.framework/OCHamcrest
1 change: 1 addition & 0 deletions Frameworks/OCHamcrest.framework/Resources
45 changes: 45 additions & 0 deletions Frameworks/OCHamcrest.framework/Versions/A/Headers/HCAllOf.h
@@ -0,0 +1,45 @@
//
// OCHamcrest - HCAllOf.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <OCHamcrest/HCBaseMatcher.h>


@interface HCAllOf : HCBaseMatcher
{
NSArray *matchers;
}

+ (instancetype)allOf:(NSArray *)theMatchers;
- (instancetype)initWithMatchers:(NSArray *)theMatchers;

@end


OBJC_EXPORT id HC_allOf(id match, ...) NS_REQUIRES_NIL_TERMINATION;

/**
allOf(firstMatcher, ...) -
Matches if all of the given matchers evaluate to @c YES.
@param firstMatcher,... A comma-separated list of matchers ending with @c nil.
The matchers are evaluated from left to right using short-circuit evaluation, so evaluation
stops as soon as a matcher returns @c NO.
Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for
equality.
(In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
@c HC_allOf instead.)
@ingroup logical_matchers
*/
#ifdef HC_SHORTHAND
#define allOf HC_allOf
#endif
45 changes: 45 additions & 0 deletions Frameworks/OCHamcrest.framework/Versions/A/Headers/HCAnyOf.h
@@ -0,0 +1,45 @@
//
// OCHamcrest - HCAnyOf.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <OCHamcrest/HCBaseMatcher.h>


@interface HCAnyOf : HCBaseMatcher
{
NSArray *matchers;
}

+ (instancetype)anyOf:(NSArray *)theMatchers;
- (instancetype)initWithMatchers:(NSArray *)theMatchers;

@end


OBJC_EXPORT id HC_anyOf(id match, ...) NS_REQUIRES_NIL_TERMINATION;

/**
anyOf(firstMatcher, ...) -
Matches if any of the given matchers evaluate to @c YES.
@param firstMatcher,... A comma-separated list of matchers ending with @c nil.
The matchers are evaluated from left to right using short-circuit evaluation, so evaluation
stops as soon as a matcher returns @c YES.
Any argument that is not a matcher is implicitly wrapped in an @ref equalTo matcher to check for
equality.
(In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
@c HC_anyOf instead.)
@ingroup logical_matchers
*/
#ifdef HC_SHORTHAND
#define anyOf HC_anyOf
#endif
42 changes: 42 additions & 0 deletions Frameworks/OCHamcrest.framework/Versions/A/Headers/HCAssertThat.h
@@ -0,0 +1,42 @@
//
// OCHamcrest - HCAssertThat.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <objc/objc-api.h>

@protocol HCMatcher;


OBJC_EXPORT void HC_assertThatWithLocation(id testCase, id actual, id <HCMatcher> matcher,
const char *fileName, int lineNumber);

#define HC_assertThat(actual, matcher) \
HC_assertThatWithLocation(self, actual, matcher, __FILE__, __LINE__)

/**
assertThat(actual, matcher) -
Asserts that actual value satisfies matcher.
@param actual The object to evaluate as the actual value.
@param matcher The matcher to satisfy as the expected condition.
@c assertThat passes the actual value to the matcher for evaluation. If the matcher is not
satisfied, an exception is thrown describing the mismatch.
@c assertThat is designed to integrate well with OCUnit and other unit testing frameworks.
Unmet assertions are reported as test failures. In Xcode, these failures can be clicked to
reveal the line of the assertion.
In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
@c HC_assertThat instead.
@ingroup integration
*/
#ifdef HC_SHORTHAND
#define assertThat HC_assertThat
#endif
@@ -0,0 +1,33 @@
//
// OCHamcrest - HCBaseDescription.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <Foundation/Foundation.h>
#import <OCHamcrest/HCDescription.h>


/**
Base class for all HCDescription implementations.
@ingroup core
*/
@interface HCBaseDescription : NSObject <HCDescription>
@end


/**
Methods that must be provided by subclasses of HCBaseDescription.
*/
@interface HCBaseDescription (SubclassMustImplement)

/**
Append the string @a str to the description.
*/
- (void)append:(NSString *)str;

@end
27 changes: 27 additions & 0 deletions Frameworks/OCHamcrest.framework/Versions/A/Headers/HCBaseMatcher.h
@@ -0,0 +1,27 @@
//
// OCHamcrest - HCBaseMatcher.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <Foundation/Foundation.h>
#import <OCHamcrest/HCMatcher.h>

#import <objc/objc-api.h> // Convenience header, to provide OBJC_EXPORT


/**
Base class for all HCMatcher implementations.
Most implementations can just implement @c -matches: and let
<code>-matches:describingMismatchTo:</code> call it. But if it makes more sense to generate the
mismatch description during the matching, override <code>-matches:describingMismatchTo:</code>
and have @c -matches: call it with a @c nil description.
@ingroup core
*/
@interface HCBaseMatcher : NSObject <HCMatcher>
@end
@@ -0,0 +1,20 @@
//
// OCHamcrest - HCClassMatcher.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <OCHamcrest/HCBaseMatcher.h>


@interface HCClassMatcher : HCBaseMatcher
{
Class theClass;
}

- (instancetype)initWithType:(Class)type;

@end
@@ -0,0 +1,23 @@
//
// OCHamcrest - HCCollectMatchers.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <Foundation/Foundation.h>
#import <objc/objc-api.h>

#import <stdarg.h>

@protocol HCMatcher;


/**
Returns an array of matchers from a variable-length comma-separated list terminated by @c nil.
@ingroup helpers
*/
OBJC_EXPORT NSMutableArray *HCCollectMatchers(id item1, va_list args);
@@ -0,0 +1,42 @@
//
// OCHamcrest - HCConformsToProtocol.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Todd Farrell
//

#import <OCHamcrest/HCBaseMatcher.h>


@interface HCConformsToProtocol : HCBaseMatcher
{
Protocol *theProtocol;
}

+ (instancetype)conformsTo:(Protocol *)protocol;
- (instancetype)initWithProtocol:(Protocol *)protocol;

@end


OBJC_EXPORT id HC_conformsTo(Protocol *aProtocol);

/**
conformsTo(aProtocol) -
Matches if object conforms to a given protocol.
@param aProtocol The protocol to compare against as the expected protocol.
This matcher checks whether the evaluated object conforms to @a aProtocol.
Example:
@li @ref conformsTo(\@protocol(NSObject))
(In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
@c HC_conformsTo instead.)
@ingroup object_matchers
*/
#ifdef HC_SHORTHAND
#define conformsTo HC_conformsTo
#endif
50 changes: 50 additions & 0 deletions Frameworks/OCHamcrest.framework/Versions/A/Headers/HCDescribedAs.h
@@ -0,0 +1,50 @@
//
// OCHamcrest - HCDescribedAs.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <OCHamcrest/HCBaseMatcher.h>


@interface HCDescribedAs : HCBaseMatcher
{
NSString *descriptionTemplate;
id <HCMatcher> matcher;
NSArray *values;
}

+ (instancetype)describedAs:(NSString *)description
forMatcher:(id <HCMatcher>)aMatcher
overValues:(NSArray *)templateValues;

- (instancetype)initWithDescription:(NSString *)description
forMatcher:(id <HCMatcher>)aMatcher
overValues:(NSArray *)templateValues;

@end


OBJC_EXPORT id HC_describedAs(NSString *description, id <HCMatcher> matcher, ...) NS_REQUIRES_NIL_TERMINATION;

/**
describedAs(description, matcher, ...) -
Adds custom failure description to a given matcher.
@param description Overrides the matcher's description.
@param matcher,... The matcher to satisfy, followed by a comma-separated list of substitution values ending with @c nil.
The description may contain substitution placeholders \%0, \%1, etc. These will be replaced by
any values that follow the matcher.
(In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
@c HC_describedAs instead.)
@ingroup decorator_matchers
*/
#ifdef HC_SHORTHAND
#define describedAs HC_describedAs
#endif
48 changes: 48 additions & 0 deletions Frameworks/OCHamcrest.framework/Versions/A/Headers/HCDescription.h
@@ -0,0 +1,48 @@
//
// OCHamcrest - HCDescription.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//

#import <Foundation/Foundation.h>


/**
A description of an HCMatcher.
An HCMatcher will describe itself to a description which can later be used for reporting.
@ingroup core
*/
@protocol HCDescription <NSObject>

/**
Appends some plain text to the description.
@return @c self, for chaining.
*/
- (id<HCDescription>)appendText:(NSString *)text;

/**
Appends description of given value to @c self.
If the value implements the @ref HCSelfDescribing protocol, then it will be used.
@return @c self, for chaining.
*/
- (id<HCDescription>)appendDescriptionOf:(id)value;

/**
Appends a list of objects to the description.
@return @c self, for chaining.
*/
- (id<HCDescription>)appendList:(NSArray *)values
start:(NSString *)start
separator:(NSString *)separator
end:(NSString *)end;

@end

0 comments on commit 9b1bd6e

Please sign in to comment.