Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functions for running specs with custom spec runner classes; optional…
… spec runner protocol delegate method called when specs start; beginnings of a view controller for displaying run status on the device or simulator; example of internal compiler error when using blocks in C++ files.
- Loading branch information
Adam Milligan
committed
Jun 7, 2010
1 parent
f6194b5
commit 7c1bef1
Showing
15 changed files
with
311 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
#import <Foundation/Foundation.h> | ||
|
||
int runSpecs(NSArray *specClasses); | ||
int runAllSpecs(); | ||
@protocol CDRExampleRunner; | ||
|
||
int runSpecsWithCustomExampleRunner(NSArray *specClasses, id<CDRExampleRunner> runner); | ||
int runAllSpecs(); | ||
int runAllSpecsWithCustomExampleRunner(id<CDRExampleRunner> runner); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#import <UIKit/UIKit.h> | ||
#import "CDRExampleRunner.h" | ||
#import "CDRDefaultRunner.h" | ||
|
||
@interface CDRExampleRunnerViewController : UITableViewController /*<CDRExampleRunner>*/ { | ||
// TODO create a real runner here. | ||
CDRDefaultRunner *stubRunner_; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#import <UIKit/UIKit.h> | ||
|
||
@class CDRExampleRunnerViewController; | ||
|
||
@interface CedarApplicationDelegate : NSObject <UIApplicationDelegate> { | ||
UIWindow *window_; | ||
CDRExampleRunnerViewController *viewController_; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#import <Foundation/Foundation.h> | ||
#import "CDRExampleBase.h" | ||
|
||
#include <iostream> | ||
#include <sstream> | ||
|
||
namespace Cedar { | ||
namespace Matchers { | ||
|
||
void fail(const NSString * failureMessage); | ||
|
||
template<typename T> | ||
class ActualValue { | ||
private: | ||
template<typename U> | ||
ActualValue(const ActualValue<U> &); | ||
template<typename U> | ||
ActualValue & operator=(const ActualValue<U> &); | ||
|
||
public: | ||
ActualValue(const T &); | ||
|
||
template<typename U> | ||
void toEqual(const U &) const; | ||
|
||
inline void foo(int i) const { std::cout << "int foo" << std::endl; } | ||
inline void foo(NSObject * i) const { std::cout << "NSObject foo" << std::endl; }; | ||
|
||
template<typename U> | ||
inline void bar(U i) const { std::cout << "template bar" << std::endl; } | ||
|
||
private: | ||
const T value_; | ||
}; | ||
|
||
#pragma mark It's 2010 and linkers still can't handle templates in implementation files? | ||
|
||
template<typename T> | ||
const ActualValue<T> expect(const T & value) { | ||
return ActualValue<T>(value); | ||
} | ||
|
||
template<typename T> | ||
ActualValue<T>::ActualValue(const T & value) : value_(value) { | ||
} | ||
|
||
#pragma mark toEqual | ||
template<typename T> template<typename U> | ||
void ActualValue<T>::toEqual(const U & expectedValue) const { | ||
if (expectedValue != value_) { | ||
std::stringstream message; | ||
message << "Expected <" << value_ << "> to equal <" << expectedValue << ">"; | ||
|
||
[[CDRSpecFailure specFailureWithReason:[NSString stringWithCString:message.str().c_str() encoding:NSUTF8StringEncoding]] raise]; | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#import "ActualValue.h" | ||
|
||
namespace Cedar { | ||
namespace Matchers { | ||
|
||
void fail(const NSString *failureMessage) { | ||
[[CDRSpecFailure specFailureWithReason:[NSString stringWithFormat:@"Failure: %@", failureMessage]] raise]; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.