Index: pkg/unittest/mock.dart |
diff --git a/pkg/unittest/mock.dart b/pkg/unittest/mock.dart |
index ded68f35dfff0cef4fa423517ae9ddb1c42a2295..91f5f7a65fd783de9e72fb1624454adc3b458d94 100644 |
--- a/pkg/unittest/mock.dart |
+++ b/pkg/unittest/mock.dart |
@@ -1274,10 +1274,13 @@ class Mock { |
* return value. If we find no [Behavior] to apply an exception is |
* thrown. |
*/ |
- noSuchMethod(String method, List args) { |
- if (method.startsWith('get:')) { |
- method = 'get ${method.substring(4)}'; |
+ noSuchMethod(InvocationMirror invocation) { |
+ String method = invocation.getterName; |
+ if (invocation.isGetter) { |
+ method = 'get $method'; |
} |
+ List args = invocation.positionalArguments; |
+ // TODO: Handle named arguments too. |
bool matchedMethodName = false; |
MatchState matchState = new MatchState(); |
for (String k in _behaviors.getKeys()) { |