Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure registerMatchers() works if defined after a spec. (Closes #64)

  • Loading branch information...
commit 28fc8f88c61c154c5b4c39d6dc1040f9659d3917 1 parent 98e9b92
@lukeredpath lukeredpath authored
View
33 Examples/SimpleSpec.m
@@ -6,8 +6,41 @@
#import "Kiwi.h"
+@interface ABCDummyMatcher : KWMatcher
+- (void)justWork;
+@end
+
+@implementation ABCDummyMatcher
+
++ (NSArray *)matcherStrings {
+ return [NSArray arrayWithObject:@"justWork"];
+}
+
+- (void)justWork {};
+
+- (BOOL)evaluate
+{
+ return YES;
+}
+
+@end
+
SPEC_BEGIN(SimpleSpec)
+describe(@"anything", ^{
+
+ it(@"allows matchers to be registered after the first spec", ^{
+ [[@"this" should] equal:@"this"];
+ });
+
+ registerMatchers(@"ABC");
+
+ it(@"can work with a custom registered matcher", ^{
+ [[@"anything" should] justWork];
+ });
+
+});
+
describe(@"stack", ^{
__block NSMutableArray *arr = nil;
View
4 Kiwi.xcodeproj/project.pbxproj
@@ -1342,7 +1342,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 0;
- GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ GCC_TREAT_WARNINGS_AS_ERRORS = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -1365,7 +1365,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
- GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+ GCC_TREAT_WARNINGS_AS_ERRORS = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
View
3  Kiwi/KWContextNode.m
@@ -105,8 +105,9 @@ - (void)performExample:(KWExample *)example withBlock:(void (^)(void))exampleBlo
void (^outerExampleBlock)(void) = ^{
@try {
+ [self.registerMatchersNode acceptExampleNodeVisitor:example];
+
if (performedExampleCount == 0) {
- [self.registerMatchersNode acceptExampleNodeVisitor:example];
[self.beforeAllNode acceptExampleNodeVisitor:example];
}
View
2  Kiwi/KWExample.m
@@ -228,7 +228,7 @@ - (void)visitItNode:(KWItNode *)aNode {
- (void)visitPendingNode:(KWPendingNode *)aNode {
if (aNode != exampleNode)
return;
-
+
[self reportResultForExampleNodeWithLabel:@"PENDING"];
}
Please sign in to comment.
Something went wrong with that request. Please try again.