Skip to content

Commit 5e8217e

Browse files
committed
integrate feedback from @felangel
1 parent bf6c914 commit 5e8217e

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ import 'package:matcher/matcher.dart';
44
extension MatcherExtensions on Matcher {
55
/// Returns the description of this matcher as a string.
66
String describeAsString() {
7-
Description description = StringDescription();
8-
description = describe(description);
9-
return description.toString();
7+
return describe(StringDescription()).toString();
108
}
119

1210
/// Returns the mismatch description of this matcher as a string.
1311
// ignore: avoid_positional_boolean_parameters
1412
String describeMismatchAsString(dynamic item, Map matchState, bool verbose) {
15-
Description description = StringDescription();
16-
description = describeMismatch(
13+
final description = describeMismatch(
1714
item,
18-
description,
15+
StringDescription(),
1916
matchState,
2017
verbose,
2118
);

lib/src/matchers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:flutter/widgets.dart';
2-
import 'package:mockingjay/src/private/matcher_extensions.dart';
2+
import 'package:mockingjay/src/matcher_extensions.dart';
33
import 'package:test/test.dart';
44

55
/// Returns a matcher that matches [Route]s.

test/src/matchers_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Future<void> expectToFail(
1515
await expectLater(actual, matcher);
1616
didNotFail = true;
1717
} on TestFailure catch (error) {
18-
if (didNotFail) {}
1918
const whichClause = ' Which: ';
2019
final whichClauseIndex = error.message!.indexOf(whichClause);
2120
final reasonIndex = whichClauseIndex + whichClause.length;

0 commit comments

Comments
 (0)