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

Unified Diff: pkg/unittest/test/mock_test.dart

Issue 14734004: Spys with mirrors! (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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
« pkg/unittest/lib/mock.dart ('K') | « pkg/unittest/lib/mock.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/mock_test.dart
===================================================================
--- pkg/unittest/test/mock_test.dart (revision 22214)
+++ pkg/unittest/test/mock_test.dart (working copy)
@@ -718,5 +718,15 @@
expect(m.foo("bar", "mock"), "C");
m.resetBehavior();
});
+
+ solo_test('Spys', () {
+ var real = new Foo();
+ var spy = new Mock.spy(real);
+ var sum = spy.sum(1, 2, 3);
+ expect(sum, 6);
+ expect(() => spy.total(1, 2, 3), throwsNoSuchMethodError);
+ spy.getLogs(callsTo('sum')).verify(happenedExactly(1));
+ spy.getLogs(callsTo('total')).verify(happenedExactly(1));
+ });
}
« pkg/unittest/lib/mock.dart ('K') | « pkg/unittest/lib/mock.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698