Skip to content

Commit

Permalink
Modify example to show how to use argument for when. (#76)
Browse files Browse the repository at this point in the history
Each time it takes me long time to find actual problem and solution,
when I run into this problem.
  • Loading branch information
rkj authored and srawlins committed Sep 18, 2017
1 parent cd12a42 commit 0c36001
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/mock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void throwOnMissingStub(Mock mock) {
///
/// // Real class.
/// class Cat {
/// String getSound() => 'Meow';
/// String getSound(String suffix) => 'Meow$suffix';
/// }
///
/// // Mock class.
Expand All @@ -66,10 +66,10 @@ void throwOnMissingStub(Mock mock) {
/// var cat = new MockCat();
///
/// // When 'getSound' is called, return 'Woof'
/// when(cat.getSound()).thenReturn('Woof');
/// when(cat.getSound(typed(any))).thenReturn('Woof');
///
/// // Try making a Cat sound...
/// print(cat.getSound()); // Prints 'Woof'
/// print(cat.getSound('foo')); // Prints 'Woof'
/// }
///
/// **WARNING**: [Mock] uses [noSuchMethod](goo.gl/r3IQUH), which is a _form_ of
Expand Down

0 comments on commit 0c36001

Please sign in to comment.