Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/ocmock/OCMock/OCMockObjectHamcrestTests.mm

Issue 9240023: Roll OCMock r77:7f521db0628086185123666b0979e48d6ecaeac1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 //------------------------------------------------------------------------------ ---------
2 // $Id: OCMockObjectTests.m 21 2008-01-24 18:59:39Z erik $
3 // Copyright (c) 2004-2008 by Mulle Kybernetik. See License file for details.
4 //------------------------------------------------------------------------------ ---------
5
6 #import <OCMock/OCMock.h>
7 #import "OCMockObjectHamcrestTests.h"
8
9 #define HC_SHORTHAND
10 #import <OCHamcrest/OCHamcrest.h>
11
12
13 @implementation OCMockObjectHamcrestTests
14
15 - (void)testAcceptsStubbedMethodWithHamcrestConstraint
16 {
17 id mock = [OCMockObject mockForClass:[NSString class]];
18 [[mock stub] hasSuffix:(id)startsWith(@"foo")];
19 [mock hasSuffix:@"foobar"];
20 }
21
22
23 - (void)testRejectsUnstubbedMethodWithHamcrestConstraint
24 {
25 id mock = [OCMockObject mockForClass:[NSString class]];
26 [[mock stub] hasSuffix:(id)anyOf(equalTo(@"foo"), equalTo(@"bar"), NULL) ];
27 STAssertThrows([mock hasSuffix:@"foobar"], @"Should have raised an excep tion.");
28 }
29
30
31 @end
OLDNEW
« no previous file with comments | « third_party/ocmock/OCMock/OCMockObjectHamcrestTests.h ('k') | third_party/ocmock/OCMock/OCMockObjectTests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698