Skip to content

Commit

Permalink
Fix custom matcher example (#56)
Browse files Browse the repository at this point in the history
Cannot be a const constructor
  • Loading branch information
kevmoo authored Jul 20, 2017
1 parent bc8ae58 commit cad3f0a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/src/core_matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -595,15 +595,18 @@ class _Predicate extends Matcher {
/// have a Widget class where each Widget has a price; we could make a
/// [CustomMatcher] that can make assertions about prices with:
///
/// class HasPrice extends CustomMatcher {
/// const HasPrice(matcher) :
/// super("Widget with price that is", "price", matcher);
/// featureValueOf(actual) => actual.price;
/// }
/// ```dart
/// class HasPrice extends CustomMatcher {
/// HasPrice(matcher) : super("Widget with price that is", "price", matcher);
/// featureValueOf(actual) => actual.price;
/// }
/// ```
///
/// and then use this for example like:
///
/// expect(inventoryItem, new HasPrice(greaterThan(0)));
/// ```dart
/// expect(inventoryItem, new HasPrice(greaterThan(0)));
/// ```
class CustomMatcher extends Matcher {
final String _featureDescription;
final String _featureName;
Expand Down

0 comments on commit cad3f0a

Please sign in to comment.