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

Unified Diff: third_party/ocmock/OCMock/OCMInvocationExpectation.m

Issue 2410583002: Test update OCMock (Closed)
Patch Set: Patch in exactly 3.1.5 Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/ocmock/OCMock/OCMInvocationExpectation.m
diff --git a/third_party/ocmock/OCMock/OCMInvocationExpectation.m b/third_party/ocmock/OCMock/OCMInvocationExpectation.m
new file mode 100644
index 0000000000000000000000000000000000000000..23338b202d452e57b041893cf25e217945db0351
--- /dev/null
+++ b/third_party/ocmock/OCMock/OCMInvocationExpectation.m
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014-2015 Erik Doernenburg and contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use these files except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+#import "OCMInvocationExpectation.h"
+#import "NSInvocation+OCMAdditions.h"
+
+@implementation OCMInvocationExpectation
+
+- (void)setMatchAndReject:(BOOL)flag {
+ matchAndReject = flag;
+ if (matchAndReject)
+ isSatisfied = YES;
+}
+
+- (BOOL)isMatchAndReject {
+ return matchAndReject;
+}
+
+- (BOOL)isSatisfied {
+ return isSatisfied;
+}
+
+- (void)handleInvocation:(NSInvocation*)anInvocation {
+ [super handleInvocation:anInvocation];
+
+ if (matchAndReject) {
+ isSatisfied = NO;
+ [NSException
+ raise:NSInternalInconsistencyException
+ format:@"%@: explicitly disallowed method invoked: %@",
+ [self description], [anInvocation invocationDescription]];
+ } else {
+ isSatisfied = YES;
+ }
+}
+
+@end
« no previous file with comments | « third_party/ocmock/OCMock/OCMInvocationExpectation.h ('k') | third_party/ocmock/OCMock/OCMInvocationMatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698