fix(shorebird_cli): shorebird doctor flutter version validator (#1133)
This commit is contained in:
@@ -93,11 +93,11 @@ class Git {
|
||||
required String directory,
|
||||
required String format,
|
||||
required String pattern,
|
||||
String? pointsAt,
|
||||
String? contains,
|
||||
}) async {
|
||||
final arguments = [
|
||||
'for-each-ref',
|
||||
if (pointsAt != null) ...['--points-at', pointsAt],
|
||||
if (contains != null) ...['--contains', contains],
|
||||
'--format',
|
||||
format,
|
||||
pattern,
|
||||
|
||||
@@ -91,7 +91,7 @@ class ShorebirdFlutter {
|
||||
/// parsed.
|
||||
Future<String?> getVersion() async {
|
||||
final result = await git.forEachRef(
|
||||
pointsAt: shorebirdEnv.flutterRevision,
|
||||
contains: shorebirdEnv.flutterRevision,
|
||||
format: '%(refname:short)',
|
||||
pattern: 'refs/remotes/origin/flutter_release/*',
|
||||
directory: _workingDirectory(),
|
||||
|
||||
@@ -223,13 +223,13 @@ origin/flutter_release/3.10.6''';
|
||||
).called(1);
|
||||
});
|
||||
|
||||
test('executes correct command w/points-at', () async {
|
||||
const pointsAt = 'revision';
|
||||
test('executes correct command w/contains', () async {
|
||||
const contains = 'revision';
|
||||
when(() => processResult.stdout).thenReturn(output);
|
||||
await expectLater(
|
||||
runWithOverrides(
|
||||
() => git.forEachRef(
|
||||
pointsAt: pointsAt,
|
||||
contains: contains,
|
||||
pattern: pattern,
|
||||
format: format,
|
||||
directory: directory,
|
||||
@@ -242,8 +242,8 @@ origin/flutter_release/3.10.6''';
|
||||
'git',
|
||||
[
|
||||
'for-each-ref',
|
||||
'--points-at',
|
||||
pointsAt,
|
||||
'--contains',
|
||||
contains,
|
||||
'--format',
|
||||
format,
|
||||
pattern,
|
||||
|
||||
@@ -78,7 +78,7 @@ void main() {
|
||||
when(
|
||||
() => git.forEachRef(
|
||||
directory: any(named: 'directory'),
|
||||
pointsAt: any(named: 'pointsAt'),
|
||||
contains: any(named: 'contains'),
|
||||
format: any(named: 'format'),
|
||||
pattern: any(named: 'pattern'),
|
||||
),
|
||||
@@ -160,7 +160,7 @@ Tools • Dart 3.0.6 • DevTools 2.23.1''');
|
||||
when(
|
||||
() => git.forEachRef(
|
||||
directory: any(named: 'directory'),
|
||||
pointsAt: any(named: 'pointsAt'),
|
||||
contains: any(named: 'contains'),
|
||||
format: any(named: 'format'),
|
||||
pattern: any(named: 'pattern'),
|
||||
),
|
||||
@@ -184,7 +184,7 @@ Tools • Dart 3.0.6 • DevTools 2.23.1''');
|
||||
verify(
|
||||
() => git.forEachRef(
|
||||
directory: p.join(flutterDirectory.parent.path, flutterRevision),
|
||||
pointsAt: flutterRevision,
|
||||
contains: flutterRevision,
|
||||
format: '%(refname:short)',
|
||||
pattern: 'refs/remotes/origin/flutter_release/*',
|
||||
),
|
||||
@@ -195,7 +195,7 @@ Tools • Dart 3.0.6 • DevTools 2.23.1''');
|
||||
when(
|
||||
() => git.forEachRef(
|
||||
directory: any(named: 'directory'),
|
||||
pointsAt: any(named: 'pointsAt'),
|
||||
contains: any(named: 'contains'),
|
||||
format: any(named: 'format'),
|
||||
pattern: any(named: 'pattern'),
|
||||
),
|
||||
@@ -207,7 +207,7 @@ Tools • Dart 3.0.6 • DevTools 2.23.1''');
|
||||
verify(
|
||||
() => git.forEachRef(
|
||||
directory: p.join(flutterDirectory.parent.path, flutterRevision),
|
||||
pointsAt: flutterRevision,
|
||||
contains: flutterRevision,
|
||||
format: '%(refname:short)',
|
||||
pattern: 'refs/remotes/origin/flutter_release/*',
|
||||
),
|
||||
@@ -222,7 +222,7 @@ Tools • Dart 3.0.6 • DevTools 2.23.1''');
|
||||
verify(
|
||||
() => git.forEachRef(
|
||||
directory: p.join(flutterDirectory.parent.path, flutterRevision),
|
||||
pointsAt: flutterRevision,
|
||||
contains: flutterRevision,
|
||||
format: '%(refname:short)',
|
||||
pattern: 'refs/remotes/origin/flutter_release/*',
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user