Skip to content

Commit 22c6cce

Browse files
committed
fix: solve merge conflicts
2 parents ced3094 + a147b63 commit 22c6cce

File tree

6 files changed

+24
-47
lines changed

6 files changed

+24
-47
lines changed

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include: package:very_good_analysis/analysis_options.6.0.0.yaml
1+
include: package:very_good_analysis/analysis_options.7.0.0.yaml

lib/mockingjay.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// A package that makes it easy to mock, test and verify
22
/// navigation calls in Flutter.
3-
library mockingjay;
3+
library;
44

55
export 'package:mocktail/mocktail.dart';
66

lib/src/matchers.dart

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,12 @@ import 'package:test/test.dart';
1818
///
1919
/// ```
2020
Matcher isRoute<T extends Object?>({
21-
@Deprecated('Use `whereName` instead') String? named,
2221
Matcher? whereSettings,
2322
Matcher? whereName,
2423
Matcher? whereArguments,
2524
Matcher? whereMaintainState,
2625
Matcher? whereFullscreenDialog,
2726
}) {
28-
// Remove once `named` argument is removed.
29-
if (whereName == null && named != null) {
30-
// ignore: parameter_assignments
31-
whereName = equals(named);
32-
}
33-
3427
assert(
3528
whereSettings == null || (whereName == null && whereArguments == null),
3629
'Cannot specify both `whereSettings` and `whereName` or `whereArguments`',
@@ -90,8 +83,8 @@ class _RouteMatcher<T> extends Matcher {
9083
hasMaintainStateMatcher ||
9184
hasFullscreenDialogMatcher;
9285

93-
/// Takes an [input] string that looks like "FooBarRoute<MyType>" and extracts
94-
/// the part "MyType".
86+
/// Takes an [input] string that looks like `FooBarRoute<MyType>` and extracts
87+
/// the part `MyType`.
9588
///
9689
/// If the `Route<` part cannot be found, it returns the input string
9790
/// unchaged.
@@ -293,8 +286,8 @@ class _RouteMatcher<T> extends Matcher {
293286
if (!maintainStateMatches) {
294287
final mismatch =
295288
item is! ModalRoute
296-
? 'is not a property on `${item.runtimeType}` and can only be used '
297-
'with `ModalRoute`s'
289+
? 'is not a property on `${item.runtimeType}` and can only be '
290+
'used with `ModalRoute`s'
298291
: whereMaintainState!.describeMismatchAsString(
299292
item.maintainState,
300293
matchState,
@@ -305,8 +298,8 @@ class _RouteMatcher<T> extends Matcher {
305298
if (!fullscreenDialogMatches) {
306299
final mismatch =
307300
item is! PageRoute
308-
? 'is not a property on `${item.runtimeType}` and can only be used '
309-
'with `PageRoute`s'
301+
? 'is not a property on `${item.runtimeType}` and can only be '
302+
'used with `PageRoute`s'
310303
: whereFullscreenDialog!.describeMismatchAsString(
311304
item.fullscreenDialog,
312305
matchState,

lib/src/mock_navigator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class _MockMaterialPageRoute extends MaterialPageRoute<void> {
1717
// By the time the setState is called, the attribute is already set
1818
// so we just ignore the error and the hack will do its job.
1919
state.insert(entry);
20-
} catch (_) {}
20+
} on Object catch (_) {}
2121
// Set mounted back to false to make sure the state doesn't get
2222
// marked as dirty during OverlayEntry.remove().
2323
state._mounted = false;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ dependencies:
1717
test: ^1.25.7
1818

1919
dev_dependencies:
20-
very_good_analysis: ^6.0.0
20+
very_good_analysis: ^7.0.0

test/src/matchers_test.dart

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_test/flutter_test.dart';
3-
import 'package:matcher/src/feature_matcher.dart';
43
import 'package:mockingjay/mockingjay.dart';
54

65
class NonModalRoute extends Mock implements TransitionRoute<void> {}
@@ -46,20 +45,8 @@ void main() {
4645
}
4746

4847
group('constructor', () {
49-
test('wraps deprecated name value in equals matcher', () {
50-
expect(
51-
// ignore: deprecated_member_use_from_same_package
52-
isRoute(named: '/test'),
53-
isA<dynamic>().having(
54-
// ignore: avoid_dynamic_calls
55-
(dynamic m) => m.whereName,
56-
'whereName',
57-
isA<FeatureMatcher<String>>(),
58-
),
59-
);
60-
});
61-
62-
test('throws AssertionError when both whereSettings '
48+
test(
49+
'throws AssertionError when both whereSettings '
6350
'and whereName or whereArguments matchers are provided', () {
6451
expect(
6552
() => isRoute(
@@ -147,7 +134,8 @@ void main() {
147134
);
148135
});
149136

150-
test('does not match anything that is not a route '
137+
test(
138+
'does not match anything that is not a route '
151139
'with matching settings', () {
152140
expectToFail(
153141
createRoute<dynamic>(name: '/test'),
@@ -232,15 +220,13 @@ is a route where the route's `name` is different.
232220
expectToFail(
233221
createRoute<dynamic>(arguments: {'a': 1}),
234222
isRoute(whereArguments: equals({'a': 2})),
235-
withMessage:
236-
"is a route where the route's `arguments` "
223+
withMessage: "is a route where the route's `arguments` "
237224
"at location ['a'] is <1> instead of <2>",
238225
);
239226
expectToFail(
240227
createRoute<dynamic>(arguments: {'a': 1}),
241228
isRoute(whereArguments: equals({'b': 1})),
242-
withMessage:
243-
"is a route where the route's `arguments` "
229+
withMessage: "is a route where the route's `arguments` "
244230
"is missing map key 'b'",
245231
);
246232
expectToFail(
@@ -257,20 +243,19 @@ is a route where the route's `name` is different.
257243
expect(createRoute<dynamic>(), isRoute(whereMaintainState: isTrue));
258244
});
259245

260-
test('does not match anything that is not a route with matching '
246+
test(
247+
'does not match anything that is not a route with matching '
261248
'maintainState argument', () {
262249
expectToFail(
263250
createRoute<dynamic>(),
264251
isRoute(whereMaintainState: isFalse),
265-
withMessage:
266-
'is a route where `maintainState` '
252+
withMessage: 'is a route where `maintainState` '
267253
'is true instead of false',
268254
);
269255
expectToFail(
270256
NonModalRoute(),
271257
isRoute(whereMaintainState: isTrue),
272-
withMessage:
273-
'is a route where `maintainState` '
258+
withMessage: 'is a route where `maintainState` '
274259
'is not a property on `NonModalRoute` and can only be used '
275260
'with `ModalRoute`s',
276261
);
@@ -290,20 +275,19 @@ is a route where the route's `name` is different.
290275
);
291276
});
292277

293-
test('does not match anything that is not a route with matching '
278+
test(
279+
'does not match anything that is not a route with matching '
294280
'fullscreenDialog argument', () {
295281
expectToFail(
296282
createRoute<dynamic>(fullscreenDialog: true),
297283
isRoute(whereFullscreenDialog: isFalse),
298-
withMessage:
299-
'is a route where `fullscreenDialog` '
284+
withMessage: 'is a route where `fullscreenDialog` '
300285
'is true instead of false',
301286
);
302287
expectToFail(
303288
NonModalRoute(),
304289
isRoute(whereFullscreenDialog: isFalse),
305-
withMessage:
306-
'is a route where `fullscreenDialog` '
290+
withMessage: 'is a route where `fullscreenDialog` '
307291
'is not a property on `NonModalRoute` and can only be used '
308292
'with `PageRoute`s',
309293
);

0 commit comments

Comments
 (0)