Skip to content

Commit

Permalink
Tests for primitive argument matching of spied methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jonreid committed Feb 23, 2013
1 parent 220f01b commit a10a769
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/Tests/MKTObjectMockSpyTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ - (NSString *)methodWithArg:(NSString *)arg
return @"unstubbed";
}

- (NSString *)methodWithInt:(int)arg
{
return @"unstubbed";
}

@end


Expand Down Expand Up @@ -140,4 +145,14 @@ - (void)testWillReturnValuesMatchingAnyArgument
assertThat([sut methodWithArg:@"bar"], is(@"foo"));
}

- (void)testWillReturnValuesMatchingPrimitiveArgument
{
// given
[[willReturn(@"foo") when:sut] methodWithInt:0];

// then
assertThat([sut methodWithInt:0], is(@"foo"));
assertThat([sut methodWithInt:1], is(@"unstubbed"));
}

@end

0 comments on commit a10a769

Please sign in to comment.