Skip to content

Added $all and $any #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ConciseKitSpecs/Frameworks/Cedar.framework/Cedar

This file was deleted.

Binary file added ConciseKitSpecs/Frameworks/Cedar.framework/Cedar
Binary file not shown.
1 change: 0 additions & 1 deletion ConciseKitSpecs/Frameworks/Cedar.framework/Headers

This file was deleted.

1 change: 0 additions & 1 deletion ConciseKitSpecs/Frameworks/Cedar.framework/Resources

This file was deleted.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#import <Foundation/Foundation.h>
#import "CDRExampleParent.h"

@protocol CDRExampleReporter;

typedef void (^CDRSpecBlock)(void);

enum CDRExampleState {
CDRExampleStateIncomplete = 0x00,
CDRExampleStatePassed = 0x01,
CDRExampleStatePending = 0x03,
CDRExampleStateFailed = 0x07,
CDRExampleStateError = 0x0F
};
typedef enum CDRExampleState CDRExampleState;

@interface CDRSpecFailure : NSException
+ (id)specFailureWithReason:(NSString *)reason;
@end

@interface CDRExampleBase : NSObject {
NSString *text_;
id<CDRExampleParent> parent_;
}

@property (nonatomic, readonly) NSString *text;
@property (nonatomic, assign) id<CDRExampleParent> parent;

- (id)initWithText:(NSString *)text;

- (void)run;
- (BOOL)hasChildren;
- (NSString *)message;
- (NSString *)fullText;
@end

@interface CDRExampleBase (RunReporting)
- (CDRExampleState)state;
- (float)progress;
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import <Foundation/Foundation.h>

@protocol CDRExampleParent

- (void)setUp;
- (void)tearDown;

@optional
- (BOOL)hasFullText;
- (NSString *)fullText;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import <Foundation/Foundation.h>

@protocol CDRExampleReporter <NSObject>

- (void)runWillStartWithGroups:(NSArray *)groups;
- (void)runDidComplete;
- (int)result;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <Foundation/Foundation.h>

@protocol CDRExampleReporter;

int runSpecsWithCustomExampleReporter(NSArray *specClasses, id<CDRExampleReporter> runner);
int runAllSpecs();
int runAllSpecsWithCustomExampleReporter(id<CDRExampleReporter> runner);
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#import <Foundation/Foundation.h>

@protocol CDRSharedExampleGroupPool
@end

typedef void (^CDRSharedExampleGroupBlock)(NSDictionary *);

#ifdef __cplusplus
extern "C" {
#endif
void sharedExamplesFor(NSString *, CDRSharedExampleGroupBlock);
void itShouldBehaveLike(NSString *);
#ifdef __cplusplus
}
#endif

@interface CDRSharedExampleGroupPool : NSObject <CDRSharedExampleGroupPool>
@end

@interface CDRSharedExampleGroupPool (SharedExampleGroupDeclaration)
- (void)declareSharedExampleGroups;
@end

#define SHARED_EXAMPLE_GROUPS_BEGIN(name) \
@interface SharedExampleGroupPoolFor##name : CDRSharedExampleGroupPool \
@end \
@implementation SharedExampleGroupPoolFor##name \
- (void)declareSharedExampleGroups {

#define SHARED_EXAMPLE_GROUPS_END \
} \
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#import <Foundation/Foundation.h>
#import "CDRExampleBase.h"

@protocol CDRExampleReporter;
@class CDRExampleGroup, SpecHelper;

@protocol CDRSpec
@end

extern CDRSpecBlock PENDING;

#ifdef __cplusplus
extern "C" {
#endif
void describe(NSString *, CDRSpecBlock);
void beforeEach(CDRSpecBlock);
void afterEach(CDRSpecBlock);
void it(NSString *, CDRSpecBlock);
void fail(NSString *);
#ifdef __cplusplus
}
#endif

@interface CDRSpec : NSObject <CDRSpec> {
CDRExampleGroup *rootGroup_;
CDRExampleGroup *currentGroup_;
}

@property (nonatomic, retain) CDRExampleGroup *currentGroup, *rootGroup;
- (void)defineBehaviors;
@end

@interface CDRSpec (SpecDeclaration)
- (void)declareBehaviors;
@end

#define SPEC_BEGIN(name) \
@interface name : CDRSpec \
@end \
@implementation name \
- (void)declareBehaviors {

#define SPEC_END \
} \
@end

#define DESCRIBE(name) \
@interface name##Spec : CDRSpec \
@end \
@implementation name##Spec \
- (void)declareBehaviors

#define DESCRIBE_END \
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#if TARGET_OS_IPHONE
#import "CDRFunctions.h"
#import "CedarApplicationDelegate.h"
#import "CDRExampleReporterViewController.h"
#else
#import "CDRFunctions.h"
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#import "CDRSpec.h"
#import "CDRSharedExampleGroupPool.h"
#import "CDRExampleParent.h"

@interface SpecHelper : NSObject <CDRExampleParent> {
NSMutableDictionary *sharedExampleGroups_, *sharedExampleContext_;
}

@property (nonatomic, retain, readonly) NSMutableDictionary *sharedExampleContext;

+ (SpecHelper *)specHelper;

- (void)beforeEach;
- (void)afterEach;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Cedar</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.Cedar</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#import <Foundation/Foundation.h>
#import "CDRExampleParent.h"

@protocol CDRExampleReporter;

typedef void (^CDRSpecBlock)(void);

enum CDRExampleState {
CDRExampleStateIncomplete = 0x00,
CDRExampleStatePassed = 0x01,
CDRExampleStatePending = 0x03,
CDRExampleStateFailed = 0x07,
CDRExampleStateError = 0x0F
};
typedef enum CDRExampleState CDRExampleState;

@interface CDRSpecFailure : NSException
+ (id)specFailureWithReason:(NSString *)reason;
@end

@interface CDRExampleBase : NSObject {
NSString *text_;
id<CDRExampleParent> parent_;
}

@property (nonatomic, readonly) NSString *text;
@property (nonatomic, assign) id<CDRExampleParent> parent;

- (id)initWithText:(NSString *)text;

- (void)run;
- (BOOL)hasChildren;
- (NSString *)message;
- (NSString *)fullText;
@end

@interface CDRExampleBase (RunReporting)
- (CDRExampleState)state;
- (float)progress;
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import <Foundation/Foundation.h>

@protocol CDRExampleParent

- (void)setUp;
- (void)tearDown;

@optional
- (BOOL)hasFullText;
- (NSString *)fullText;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import <Foundation/Foundation.h>

@protocol CDRExampleReporter <NSObject>

- (void)runWillStartWithGroups:(NSArray *)groups;
- (void)runDidComplete;
- (int)result;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <Foundation/Foundation.h>

@protocol CDRExampleReporter;

int runSpecsWithCustomExampleReporter(NSArray *specClasses, id<CDRExampleReporter> runner);
int runAllSpecs();
int runAllSpecsWithCustomExampleReporter(id<CDRExampleReporter> runner);
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#import <Foundation/Foundation.h>

@protocol CDRSharedExampleGroupPool
@end

typedef void (^CDRSharedExampleGroupBlock)(NSDictionary *);

#ifdef __cplusplus
extern "C" {
#endif
void sharedExamplesFor(NSString *, CDRSharedExampleGroupBlock);
void itShouldBehaveLike(NSString *);
#ifdef __cplusplus
}
#endif

@interface CDRSharedExampleGroupPool : NSObject <CDRSharedExampleGroupPool>
@end

@interface CDRSharedExampleGroupPool (SharedExampleGroupDeclaration)
- (void)declareSharedExampleGroups;
@end

#define SHARED_EXAMPLE_GROUPS_BEGIN(name) \
@interface SharedExampleGroupPoolFor##name : CDRSharedExampleGroupPool \
@end \
@implementation SharedExampleGroupPoolFor##name \
- (void)declareSharedExampleGroups {

#define SHARED_EXAMPLE_GROUPS_END \
} \
@end
54 changes: 54 additions & 0 deletions ConciseKitSpecs/Frameworks/Cedar.framework/headers/CDRSpec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#import <Foundation/Foundation.h>
#import "CDRExampleBase.h"

@protocol CDRExampleReporter;
@class CDRExampleGroup, SpecHelper;

@protocol CDRSpec
@end

extern CDRSpecBlock PENDING;

#ifdef __cplusplus
extern "C" {
#endif
void describe(NSString *, CDRSpecBlock);
void beforeEach(CDRSpecBlock);
void afterEach(CDRSpecBlock);
void it(NSString *, CDRSpecBlock);
void fail(NSString *);
#ifdef __cplusplus
}
#endif

@interface CDRSpec : NSObject <CDRSpec> {
CDRExampleGroup *rootGroup_;
CDRExampleGroup *currentGroup_;
}

@property (nonatomic, retain) CDRExampleGroup *currentGroup, *rootGroup;
- (void)defineBehaviors;
@end

@interface CDRSpec (SpecDeclaration)
- (void)declareBehaviors;
@end

#define SPEC_BEGIN(name) \
@interface name : CDRSpec \
@end \
@implementation name \
- (void)declareBehaviors {

#define SPEC_END \
} \
@end

#define DESCRIBE(name) \
@interface name##Spec : CDRSpec \
@end \
@implementation name##Spec \
- (void)declareBehaviors

#define DESCRIBE_END \
@end
7 changes: 7 additions & 0 deletions ConciseKitSpecs/Frameworks/Cedar.framework/headers/Cedar.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#if TARGET_OS_IPHONE
#import "CDRFunctions.h"
#import "CedarApplicationDelegate.h"
#import "CDRExampleReporterViewController.h"
#else
#import "CDRFunctions.h"
#endif
Loading