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

Issue 10718002: Changed the syntax some. All the handling of variable argument lists is (Closed)

Created:
8 years, 5 months ago by gram
Modified:
8 years, 5 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Changed the syntax some. All the handling of variable argument lists is moved to a function callsTo(), and when() is renamed whenThereAre(), so we write m.whenThereAre(callsTo(...)). Verification is moved out of Mock; Mock just returns the matching log, and LogEntrySet verify() is used instead. Added the ability to proxy calls, so we can create spys. Added the ability to verify return values. Added some tests. Committed: https://code.google.com/p/dart/source/detail?r=9212

Patch Set 1 #

Total comments: 19

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+433 lines, -84 lines) Patch
M lib/unittest/mock.dart View 1 2 3 4 12 chunks +329 lines, -82 lines 0 comments Download
M tests/lib/unittest/unittest_test.dart View 1 2 4 chunks +104 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
gram
Some cool stuff.
8 years, 5 months ago (2012-06-27 23:11:42 UTC) #1
Siggi Cherem (dart-lang)
https://chromiumcodereview.appspot.com/10718002/diff/1/lib/unittest/mock.dart File lib/unittest/mock.dart (right): https://chromiumcodereview.appspot.com/10718002/diff/1/lib/unittest/mock.dart#newcode204 lib/unittest/mock.dart:204: Behavior thenCall(value, [count = 1]) { what is [value]. ...
8 years, 5 months ago (2012-06-28 00:44:40 UTC) #2
gram
PTAL https://chromiumcodereview.appspot.com/10718002/diff/1/lib/unittest/mock.dart File lib/unittest/mock.dart (right): https://chromiumcodereview.appspot.com/10718002/diff/1/lib/unittest/mock.dart#newcode204 lib/unittest/mock.dart:204: Behavior thenCall(value, [count = 1]) { On 2012/06/28 ...
8 years, 5 months ago (2012-06-28 17:32:54 UTC) #3
Siggi Cherem (dart-lang)
8 years, 5 months ago (2012-06-28 17:51:43 UTC) #4
LGTM! Thanks Gram! (minor comments below...)

https://chromiumcodereview.appspot.com/10718002/diff/3001/lib/unittest/mock.dart
File lib/unittest/mock.dart (right):

https://chromiumcodereview.appspot.com/10718002/diff/3001/lib/unittest/mock.d...
lib/unittest/mock.dart:636: *     mock.forThe(callsTo(...)).verify(...);
should we keep this example below? 

getLogs(mock, callsTo(...)).verify(...);

https://chromiumcodereview.appspot.com/10718002/diff/9001/lib/unittest/mock.dart
File lib/unittest/mock.dart (right):

https://chromiumcodereview.appspot.com/10718002/diff/9001/lib/unittest/mock.d...
lib/unittest/mock.dart:228: /** toString() just returns the matcher. */
nits:
- no need to mention the method name here
- that sounds like if you were returning a matcher, not a string.

=> Returns the matcher's string representation?

https://chromiumcodereview.appspot.com/10718002/diff/9001/lib/unittest/mock.d...
lib/unittest/mock.dart:349: /**
+1 line here too :)

https://chromiumcodereview.appspot.com/10718002/diff/9001/lib/unittest/mock.d...
lib/unittest/mock.dart:352: * [forThe], a [LogEntrySet] of matching call logs is
returned;
:1,$s/forThe/getLogs/g

https://chromiumcodereview.appspot.com/10718002/diff/9001/lib/unittest/mock.d...
lib/unittest/mock.dart:667: return mock.log.getMatches(logFilter, destructive);
<< (only +2 indent)

Powered by Google App Engine
This is Rietveld 408576698