Permalink
Browse files

Examples: Stubbing most primitive returns is easier

  • Loading branch information...
1 parent fb2e369 commit 67d9a1d7eebfdfeb6b11980482f766d723457003 @jonreid committed Nov 25, 2011
Showing with 2 additions and 4 deletions.
  1. +1 −2 Examples/MacExample/Example.m
  2. +1 −2 Examples/iOSExample/Example.m
View
3 Examples/MacExample/Example.m
@@ -80,8 +80,7 @@ - (void)testStubReturningPrimitive
{
NSArray *mockArray = mock([NSArray class]);
- [mockArray count];
- [givenPreviousCall willReturnUnsignedInteger:3];
+ [given([mockArray count]) willReturnUnsignedInteger:3];
assertThatUnsignedInteger([mockArray count], is(equalToUnsignedInteger(3)));
}
View
3 Examples/iOSExample/Example.m
@@ -80,8 +80,7 @@ - (void)testStubReturningPrimitive
{
NSArray *mockArray = mock([NSArray class]);
- [mockArray count];
- [givenPreviousCall willReturnUnsignedInteger:3];
+ [given([mockArray count]) willReturnUnsignedInteger:3];
assertThatUnsignedInteger([mockArray count], is(equalToUnsignedInteger(3)));
}

0 comments on commit 67d9a1d

Please sign in to comment.