allow subclasses of KIFTestStep to take action when step fails #154

Merged
merged 1 commit into from Dec 7, 2012

3 participants

@paulz

fix test condition macro to use current step class to report failed step instead of base class
add test step instance method to respond to test failures

@blazingpair blazingpair add instance method stepFailed to test step to allow subclasses to re…
…spond to failures

    use current step class to report failed step instead of base class
c85d581
@puls puls merged commit b7c77db into kif-framework:master Dec 7, 2012
@matvore matvore commented on the diff Dec 7, 2012
Classes/KIFTestStep.h
@@ -23,7 +23,7 @@
if (error) { \
*error = [NSError errorWithDomain:@"KIFTest" code:KIFTestStepResultFailure userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:__VA_ARGS__], NSLocalizedDescriptionKey, nil]]; \
} \
- [KIFTestStep stepFailed]; \
+ [self stepFailed]; \
@matvore
matvore added a note Dec 7, 2012

Shouldn't this line be deleted? You are already calling stepFailed in KIFTestController.m, and this change breaks any test case where "self" doesn't refer to a step.
In my scenarios, I define a lot of steps inline in the scenario, because they are only relevant for that single scenario. This line causes a compilation error for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment