diff options
Diffstat (limited to 'src/com/google')
-rw-r--r-- | src/com/google/testing/littlemock/LittleMock.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/google/testing/littlemock/LittleMock.java b/src/com/google/testing/littlemock/LittleMock.java index 0d93c4f..9946798 100644 --- a/src/com/google/testing/littlemock/LittleMock.java +++ b/src/com/google/testing/littlemock/LittleMock.java @@ -898,7 +898,7 @@ public class LittleMock { } /** Represents something capable of testing if it matches an argument or not. */ - /*package*/ interface ArgumentMatcher { + public interface ArgumentMatcher { public boolean matches(Object value); } @@ -980,6 +980,12 @@ public class LittleMock { return value; } + /** A custom argument matcher, should be used only for object arguments not primitives. */ + public static <T> T matches(ArgumentMatcher argument) { + sMatchArguments.add(argument); + return null; + } + /** Utility method to throw an AssertionError if an assertion fails. */ private static void expect(boolean result, String message) { if (!result) { |