Permalink
Browse files

Verify parameters are passed correctly

  • Loading branch information...
1 parent ca41894 commit aa37c32382ffbab16ac50b7f5c47481b68609841 @eraserhd eraserhd committed Dec 11, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 Tests/KWMockTest.m
View
4 Tests/KWMockTest.m
@@ -325,6 +325,8 @@ - (void)testItShouldAllowStubbingSetValueForKey {
id mock = [Cruiser mock];
__block BOOL called = NO;
[mock stub:@selector(setValue:forKey:) withBlock:^id(NSArray *params) {
+ STAssertEquals([params objectAtIndex:0], @"baz", @"expected arg 1 of setValue:forKey: to be 'baz'");
+ STAssertEquals([params objectAtIndex:1], @"foo", @"expected arg 2 of setValue:forKey: to be 'foo'");
called = YES;
return nil;
}];
@@ -336,6 +338,8 @@ - (void)testItShouldAllowStubbingSetValueForKeyPath {
id mock = [Cruiser mock];
__block BOOL called = NO;
[mock stub:@selector(setValue:forKeyPath:) withBlock:^id(NSArray *params) {
+ STAssertEquals([params objectAtIndex:0], @"baz", @"expected arg 1 of setValue:forKeyPath: to be 'baz'");
+ STAssertEquals([params objectAtIndex:1], @"foo.bar", @"expected arg 2 of setValue:forKey: to be 'foo.bar'");
called = YES;
return nil;
}];

0 comments on commit aa37c32

Please sign in to comment.