Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use KWFormatter for haveValue: failure messages

  • Loading branch information...
commit 18cf4abbbcf5fc38b1a1746721ab433d68190454 1 parent 2e5f161
@eraserhd eraserhd authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 Kiwi/KWHaveValueMatcher.m
View
12 Kiwi/KWHaveValueMatcher.m
@@ -70,13 +70,19 @@ - (BOOL)evaluate {
- (NSString *)failureMessageForShould {
if (self.expectedValue == nil) {
- return [NSString stringWithFormat:@"expected subject to have a value for key %@", self.expectedKey];
+ return [NSString stringWithFormat:@"expected subject to have a value for key %@",
+ [KWFormatter formatObject:self.expectedKey]];
}
id subjectValue = [self subjectValue];
if (subjectValue) {
- return [NSString stringWithFormat:@"expected subject to have value %@ for key %@, but it had value %@ instead", self.expectedValue, self.expectedKey, subjectValue];
+ return [NSString stringWithFormat:@"expected subject to have value %@ for key %@, but it had value %@ instead",
+ [KWFormatter formatObject:self.expectedValue],
+ [KWFormatter formatObject:self.expectedKey],
+ [KWFormatter formatObject:subjectValue]];
} else {
- return [NSString stringWithFormat:@"expected subject to have value %@ for key %@, but the key was not present", self.expectedValue, self.expectedKey];
+ return [NSString stringWithFormat:@"expected subject to have value %@ for key %@, but the key was not present",
+ [KWFormatter formatObject:self.expectedValue],
+ [KWFormatter formatObject:self.expectedKey]];
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.