diff --git a/lib/src/cli/dart_cli.dart b/lib/src/cli/dart_cli.dart index e79f65d42..12940b9a6 100644 --- a/lib/src/cli/dart_cli.dart +++ b/lib/src/cli/dart_cli.dart @@ -14,6 +14,50 @@ class Dart { } } + /// Install dart dependencies (`dart pub get`). + static Future pubGet({ + required Logger logger, + String cwd = '.', + bool recursive = false, + Set ignore = const {}, + }) async { + final initialCwd = cwd; + + final result = await _runCommand( + cmd: (cwd) async { + final relativePath = p.relative(cwd, from: initialCwd); + final path = + relativePath == '.' ? '.' : '.${p.context.separator}$relativePath'; + + final installProgress = logger.progress( + 'Running "dart pub get" in $path', + ); + + try { + await _verifyGitDependencies(cwd, logger: logger); + } catch (_) { + installProgress.fail(); + rethrow; + } + + try { + return await _Cmd.run( + 'dart', + ['pub', 'get'], + workingDirectory: cwd, + logger: logger, + ); + } finally { + installProgress.complete(); + } + }, + cwd: cwd, + recursive: recursive, + ignore: ignore, + ); + return result.every((e) => e.exitCode == ExitCode.success.code); + } + /// Apply all fixes (`dart fix --apply`). static Future applyFixes({ required Logger logger, diff --git a/lib/src/cli/flutter_cli.dart b/lib/src/cli/flutter_cli.dart index adea63cd4..3c999c704 100644 --- a/lib/src/cli/flutter_cli.dart +++ b/lib/src/cli/flutter_cli.dart @@ -2,8 +2,7 @@ part of 'cli.dart'; const _testOptimizerFileName = '.test_optimizer.dart'; -/// Thrown when `flutter packages get` or `flutter pub get` -/// is executed without a `pubspec.yaml`. +/// Thrown when `flutter pub get` is executed without a `pubspec.yaml`. class PubspecNotFound implements Exception {} /// {@template coverage_not_met} @@ -77,8 +76,8 @@ class Flutter { } } - /// Install flutter dependencies (`flutter packages get`). - static Future packagesGet({ + /// Install dart dependencies (`flutter pub get`). + static Future pubGet({ required Logger logger, String cwd = '.', bool recursive = false, @@ -86,14 +85,14 @@ class Flutter { }) async { final initialCwd = cwd; - await _runCommand( + final result = await _runCommand( cmd: (cwd) async { final relativePath = p.relative(cwd, from: initialCwd); final path = relativePath == '.' ? '.' : '.${p.context.separator}$relativePath'; final installProgress = logger.progress( - 'Running "flutter packages get" in $path ', + 'Running "flutter pub get" in $path ', ); try { @@ -104,9 +103,9 @@ class Flutter { } try { - await _Cmd.run( + return await _Cmd.run( 'flutter', - ['packages', 'get'], + ['pub', 'get'], workingDirectory: cwd, logger: logger, ); @@ -118,26 +117,7 @@ class Flutter { recursive: recursive, ignore: ignore, ); - } - - /// Install dart dependencies (`flutter pub get`). - static Future pubGet({ - required Logger logger, - String cwd = '.', - bool recursive = false, - Set ignore = const {}, - }) async { - await _runCommand( - cmd: (cwd) => _Cmd.run( - 'flutter', - ['pub', 'get'], - workingDirectory: cwd, - logger: logger, - ), - cwd: cwd, - recursive: recursive, - ignore: ignore, - ); + return result.every((e) => e.exitCode == ExitCode.success.code); } /// Run tests (`flutter test`). diff --git a/lib/src/cli/git_cli.dart b/lib/src/cli/git_cli.dart index b62a27d7f..e5df06310 100644 --- a/lib/src/cli/git_cli.dart +++ b/lib/src/cli/git_cli.dart @@ -1,8 +1,7 @@ part of 'cli.dart'; /// {@template unreachable_git_dependency} -/// Thrown when `flutter packages get` or `flutter pub get` -/// encounters an unreachable git dependency. +/// Thrown when `flutter pub get` encounters an unreachable git dependency. /// {@endtemplate} class UnreachableGitDependency implements Exception { /// {@macro unreachable_git_dependency} diff --git a/lib/src/commands/create/templates/post_generate_actions.dart b/lib/src/commands/create/templates/post_generate_actions.dart index d193aee0a..9e3c0aa19 100644 --- a/lib/src/commands/create/templates/post_generate_actions.dart +++ b/lib/src/commands/create/templates/post_generate_actions.dart @@ -2,35 +2,42 @@ import 'package:mason/mason.dart'; import 'package:universal_io/io.dart'; import 'package:very_good_cli/src/cli/cli.dart'; -/// Runs `flutter pub get` in the [outputDir]. -Future installDartPackages( +/// Runs `dart pub get` in the [outputDir]. +/// +/// Completes with `true` is the execution was successful, `false` otherwise. +Future installDartPackages( Logger logger, - Directory outputDir, -) async { - final isFlutterInstalled = await Flutter.installed(logger: logger); - if (isFlutterInstalled) { - final installDependenciesProgress = logger.progress( - 'Running "flutter pub get" in ${outputDir.path}', + Directory outputDir, { + bool recursive = false, +}) async { + final isDartInstalled = await Dart.installed(logger: logger); + if (isDartInstalled) { + return Dart.pubGet( + cwd: outputDir.path, + recursive: recursive, + logger: logger, ); - await Flutter.pubGet(cwd: outputDir.path, logger: logger); - installDependenciesProgress.complete(); } + return false; } -/// Runs `flutter packages get` in the [outputDir]. -Future installFlutterPackages( +/// Runs `flutter pub get` in the [outputDir]. +/// +/// Completes with `true` is the execution was successful, `false` otherwise. +Future installFlutterPackages( Logger logger, Directory outputDir, { bool recursive = false, }) async { final isFlutterInstalled = await Flutter.installed(logger: logger); if (isFlutterInstalled) { - await Flutter.packagesGet( + return Flutter.pubGet( cwd: outputDir.path, recursive: recursive, logger: logger, ); } + return false; } /// Runs `dart fix --apply` in the [outputDir]. diff --git a/lib/src/commands/create/templates/very_good_core/very_good_core_template.dart b/lib/src/commands/create/templates/very_good_core/very_good_core_template.dart index c77fdaa82..987ddd785 100644 --- a/lib/src/commands/create/templates/very_good_core/very_good_core_template.dart +++ b/lib/src/commands/create/templates/very_good_core/very_good_core_template.dart @@ -18,8 +18,9 @@ class VeryGoodCoreTemplate extends Template { @override Future onGenerateComplete(Logger logger, Directory outputDir) async { - await installFlutterPackages(logger, outputDir); - await applyDartFixes(logger, outputDir); + if (await installFlutterPackages(logger, outputDir)) { + await applyDartFixes(logger, outputDir); + } _logSummary(logger, outputDir); } diff --git a/lib/src/commands/create/templates/very_good_dart_cli/very_good_dart_cli_template.dart b/lib/src/commands/create/templates/very_good_dart_cli/very_good_dart_cli_template.dart index 54f8711d6..a1cb1342a 100644 --- a/lib/src/commands/create/templates/very_good_dart_cli/very_good_dart_cli_template.dart +++ b/lib/src/commands/create/templates/very_good_dart_cli/very_good_dart_cli_template.dart @@ -18,8 +18,9 @@ class VeryGoodDartCLITemplate extends Template { @override Future onGenerateComplete(Logger logger, Directory outputDir) async { - await installDartPackages(logger, outputDir); - await applyDartFixes(logger, outputDir); + if (await installDartPackages(logger, outputDir)) { + await applyDartFixes(logger, outputDir); + } _logSummary(logger); } diff --git a/lib/src/commands/create/templates/very_good_dart_package/very_good_dart_package_template.dart b/lib/src/commands/create/templates/very_good_dart_package/very_good_dart_package_template.dart index 055f2953d..e55c617bd 100644 --- a/lib/src/commands/create/templates/very_good_dart_package/very_good_dart_package_template.dart +++ b/lib/src/commands/create/templates/very_good_dart_package/very_good_dart_package_template.dart @@ -17,8 +17,9 @@ class DartPkgTemplate extends Template { @override Future onGenerateComplete(Logger logger, Directory outputDir) async { - await installDartPackages(logger, outputDir); - await applyDartFixes(logger, outputDir); + if (await installDartPackages(logger, outputDir)) { + await applyDartFixes(logger, outputDir); + } _logSummary(logger); } diff --git a/lib/src/commands/create/templates/very_good_flame_game/very_good_flame_game_template.dart b/lib/src/commands/create/templates/very_good_flame_game/very_good_flame_game_template.dart index 0483f8306..0598da9e2 100644 --- a/lib/src/commands/create/templates/very_good_flame_game/very_good_flame_game_template.dart +++ b/lib/src/commands/create/templates/very_good_flame_game/very_good_flame_game_template.dart @@ -18,8 +18,9 @@ class VeryGoodFlameGameTemplate extends Template { @override Future onGenerateComplete(Logger logger, Directory outputDir) async { - await installDartPackages(logger, outputDir); - await applyDartFixes(logger, outputDir); + if (await installFlutterPackages(logger, outputDir)) { + await applyDartFixes(logger, outputDir); + } _logSummary(logger); } diff --git a/lib/src/commands/create/templates/very_good_flutter_package/very_good_flutter_package_template.dart b/lib/src/commands/create/templates/very_good_flutter_package/very_good_flutter_package_template.dart index a508e7729..ed9fbbd16 100644 --- a/lib/src/commands/create/templates/very_good_flutter_package/very_good_flutter_package_template.dart +++ b/lib/src/commands/create/templates/very_good_flutter_package/very_good_flutter_package_template.dart @@ -17,8 +17,9 @@ class FlutterPkgTemplate extends Template { @override Future onGenerateComplete(Logger logger, Directory outputDir) async { - await installFlutterPackages(logger, outputDir); - await applyDartFixes(logger, outputDir); + if (await installFlutterPackages(logger, outputDir)) { + await applyDartFixes(logger, outputDir); + } _logSummary(logger); } diff --git a/lib/src/commands/create/templates/very_good_flutter_plugin/very_good_flutter_plugin_template.dart b/lib/src/commands/create/templates/very_good_flutter_plugin/very_good_flutter_plugin_template.dart index 7ff2ede4c..ecdf326eb 100644 --- a/lib/src/commands/create/templates/very_good_flutter_plugin/very_good_flutter_plugin_template.dart +++ b/lib/src/commands/create/templates/very_good_flutter_plugin/very_good_flutter_plugin_template.dart @@ -17,8 +17,9 @@ class FlutterPluginTemplate extends Template { @override Future onGenerateComplete(Logger logger, Directory outputDir) async { - await installFlutterPackages(logger, outputDir, recursive: true); - await applyDartFixes(logger, outputDir, recursive: true); + if (await installFlutterPackages(logger, outputDir, recursive: true)) { + await applyDartFixes(logger, outputDir, recursive: true); + } _logSummary(logger); } diff --git a/lib/src/commands/create/templates/very_good_wear_app/very_good_wear_app_template.dart b/lib/src/commands/create/templates/very_good_wear_app/very_good_wear_app_template.dart index 4de0706b3..ff1ca64ca 100644 --- a/lib/src/commands/create/templates/very_good_wear_app/very_good_wear_app_template.dart +++ b/lib/src/commands/create/templates/very_good_wear_app/very_good_wear_app_template.dart @@ -18,8 +18,9 @@ class VeryGoodWearAppTemplate extends Template { @override Future onGenerateComplete(Logger logger, Directory outputDir) async { - await installFlutterPackages(logger, outputDir); - await applyDartFixes(logger, outputDir); + if (await installFlutterPackages(logger, outputDir)) { + await applyDartFixes(logger, outputDir); + } _logSummary(logger); } diff --git a/lib/src/commands/packages/commands/get.dart b/lib/src/commands/packages/commands/get.dart index f1753b15b..7c4f00530 100644 --- a/lib/src/commands/packages/commands/get.dart +++ b/lib/src/commands/packages/commands/get.dart @@ -52,7 +52,7 @@ class PackagesGetCommand extends Command { final isFlutterInstalled = await Flutter.installed(logger: _logger); if (isFlutterInstalled) { try { - await Flutter.packagesGet( + await Flutter.pubGet( cwd: targetPath, recursive: recursive, ignore: ignore, diff --git a/test/src/cli/dart_cli_test.dart b/test/src/cli/dart_cli_test.dart index 9e7db1107..839fe36c0 100644 --- a/test/src/cli/dart_cli_test.dart +++ b/test/src/cli/dart_cli_test.dart @@ -1,9 +1,25 @@ import 'package:mason/mason.dart'; import 'package:mocktail/mocktail.dart'; +import 'package:path/path.dart' as p; import 'package:test/test.dart'; import 'package:universal_io/io.dart'; import 'package:very_good_cli/src/cli/cli.dart'; +const _pubspec = ''' +name: example + +dev_dependencies: + test: any'''; + +const _unreachableGitUrlPubspec = ''' +name: example + +dev_dependencies: + very_good_analysis: + git: + url: https://github.com/verygoodopensource/_very_good_analysis +'''; + class _TestProcess { Future run( String command, @@ -23,7 +39,19 @@ class _MockProgress extends Mock implements Progress {} void main() { group('Dart', () { - final processResult = ProcessResult(42, ExitCode.success.code, '', ''); + final successProcessResult = ProcessResult( + 42, + ExitCode.success.code, + '', + '', + ); + final softwareErrorProcessResult = ProcessResult( + 42, + ExitCode.software.code, + '', + 'Some error', + ); + late _TestProcess process; late Logger logger; late Progress progress; @@ -41,7 +69,7 @@ void main() { runInShell: any(named: 'runInShell'), workingDirectory: any(named: 'workingDirectory'), ), - ).thenAnswer((_) async => processResult); + ).thenAnswer((_) async => successProcessResult); }); group('.installed', () { @@ -77,6 +105,179 @@ void main() { }); }); + group('.pubGet', () { + test('throws when there is no pubspec.yaml', () { + ProcessOverrides.runZoned( + () => expectLater( + Dart.pubGet(cwd: Directory.systemTemp.path, logger: logger), + throwsA(isA()), + ), + runProcess: process.run, + ); + }); + + test('throws when process fails', () { + when( + () => process.run( + 'flutter', + any(), + runInShell: any(named: 'runInShell'), + workingDirectory: any(named: 'workingDirectory'), + ), + ).thenAnswer((_) async => softwareErrorProcessResult); + ProcessOverrides.runZoned( + () => expectLater( + Dart.pubGet(cwd: Directory.systemTemp.path, logger: logger), + throwsException, + ), + runProcess: process.run, + ); + }); + + test('completes when the process succeeds', () { + ProcessOverrides.runZoned( + () => expectLater(Dart.pubGet(logger: logger), completes), + runProcess: process.run, + ); + }); + + test('completes when the process succeeds (recursive)', () { + ProcessOverrides.runZoned( + () => expectLater( + Dart.pubGet(recursive: true, logger: logger), + completes, + ), + runProcess: process.run, + ); + }); + + test( + 'completes when there is a pubspec.yaml and ' + 'directory is ignored (recursive)', + () { + final tempDirectory = Directory.systemTemp.createTempSync(); + addTearDown(() => tempDirectory.deleteSync(recursive: true)); + + final nestedDirectory = Directory(p.join(tempDirectory.path, 'test')) + ..createSync(); + final ignoredDirectory = Directory( + p.join(tempDirectory.path, 'test_plugin'), + )..createSync(); + + File(p.join(nestedDirectory.path, 'pubspec.yaml')) + .writeAsStringSync(_pubspec); + File(p.join(ignoredDirectory.path, 'pubspec.yaml')) + .writeAsStringSync(_pubspec); + + final relativePathPrefix = '.${p.context.separator}'; + + ProcessOverrides.runZoned( + () => expectLater( + Dart.pubGet( + cwd: tempDirectory.path, + recursive: true, + ignore: { + 'test_plugin', + '/**/test_plugin_two/**', + }, + logger: logger, + ), + completes, + ), + runProcess: process.run, + ).whenComplete(() { + final nestedRelativePath = + p.relative(nestedDirectory.path, from: tempDirectory.path); + + verify(() { + logger.progress( + any( + that: contains( + '''Running "dart pub get" in $relativePathPrefix$nestedRelativePath''', + ), + ), + ); + }).called(1); + + verifyNever(() { + final ignoredRelativePath = p.relative( + ignoredDirectory.path, + from: tempDirectory.path, + ); + + logger.progress( + any( + that: contains( + '''Running "dart pub get" in $relativePathPrefix$ignoredRelativePath''', + ), + ), + ); + }); + }); + }, + ); + + test('throws when process fails', () { + when( + () => process.run( + any(), + any(), + runInShell: any(named: 'runInShell'), + workingDirectory: any(named: 'workingDirectory'), + ), + ).thenAnswer((_) async => softwareErrorProcessResult); + + ProcessOverrides.runZoned( + () => expectLater(Dart.pubGet(logger: logger), throwsException), + runProcess: process.run, + ); + }); + + test('throws when process fails (recursive)', () { + when( + () => process.run( + any(), + any(), + runInShell: any(named: 'runInShell'), + workingDirectory: any(named: 'workingDirectory'), + ), + ).thenAnswer((_) async => softwareErrorProcessResult); + + ProcessOverrides.runZoned( + () => expectLater( + Dart.pubGet(recursive: true, logger: logger), + throwsException, + ), + runProcess: process.run, + ); + }); + + test('throws when there is an unreachable git url', () { + final tempDirectory = Directory.systemTemp.createTempSync(); + addTearDown(() => tempDirectory.deleteSync(recursive: true)); + + File(p.join(tempDirectory.path, 'pubspec.yaml')) + .writeAsStringSync(_unreachableGitUrlPubspec); + + when( + () => process.run( + 'git', + any(that: contains('ls-remote')), + runInShell: any(named: 'runInShell'), + workingDirectory: any(named: 'workingDirectory'), + ), + ).thenAnswer((_) async => softwareErrorProcessResult); + + ProcessOverrides.runZoned( + () => expectLater( + () => Dart.pubGet(cwd: tempDirectory.path, logger: logger), + throwsA(isA()), + ), + runProcess: process.run, + ); + }); + }); + group('.applyFixes', () { test('completes normally', () { ProcessOverrides.runZoned( diff --git a/test/src/cli/flutter_cli_test.dart b/test/src/cli/flutter_cli_test.dart index fc52ccae0..28b4c766c 100644 --- a/test/src/cli/flutter_cli_test.dart +++ b/test/src/cli/flutter_cli_test.dart @@ -91,14 +91,11 @@ void main() { ).thenAnswer((_) async => successProcessResult); }); - group('.packagesGet', () { + group('.pubGet', () { test('throws when there is no pubspec.yaml', () { ProcessOverrides.runZoned( () => expectLater( - Flutter.packagesGet( - cwd: Directory.systemTemp.path, - logger: logger, - ), + Flutter.pubGet(cwd: Directory.systemTemp.path, logger: logger), throwsA(isA()), ), runProcess: process.run, @@ -114,63 +111,27 @@ void main() { workingDirectory: any(named: 'workingDirectory'), ), ).thenAnswer((_) async => softwareErrorProcessResult); - ProcessOverrides.runZoned( () => expectLater( - Flutter.packagesGet( - cwd: Directory.systemTemp.path, - logger: logger, - ), + Flutter.pubGet(cwd: Directory.systemTemp.path, logger: logger), throwsException, ), runProcess: process.run, ); }); - test('throws when there is an unreachable git url', () { - final tempDirectory = Directory.systemTemp.createTempSync(); - addTearDown(() => tempDirectory.deleteSync(recursive: true)); - - File(p.join(tempDirectory.path, 'pubspec.yaml')) - .writeAsStringSync(_unreachableGitUrlPubspec); - - when( - () => process.run( - 'git', - any(that: contains('ls-remote')), - runInShell: any(named: 'runInShell'), - workingDirectory: any(named: 'workingDirectory'), - ), - ).thenAnswer((_) async => softwareErrorProcessResult); - - ProcessOverrides.runZoned( - () => expectLater( - () => Flutter.packagesGet(cwd: tempDirectory.path, logger: logger), - throwsA(isA()), - ), - runProcess: process.run, - ); - }); - test('completes when the process succeeds', () { ProcessOverrides.runZoned( - () => expectLater(Flutter.packagesGet(logger: logger), completes), + () => expectLater(Flutter.pubGet(logger: logger), completes), runProcess: process.run, ); }); - test('throws when there is no pubspec.yaml (recursive)', () { - final tempDirectory = Directory.systemTemp.createTempSync(); - addTearDown(() => tempDirectory.deleteSync(recursive: true)); - + test('completes when the process succeeds (recursive)', () { ProcessOverrides.runZoned( () => expectLater( - Flutter.packagesGet( - cwd: tempDirectory.path, - recursive: true, - logger: logger, - ), - throwsA(isA()), + Flutter.pubGet(recursive: true, logger: logger), + completes, ), runProcess: process.run, ); @@ -198,7 +159,7 @@ void main() { ProcessOverrides.runZoned( () => expectLater( - Flutter.packagesGet( + Dart.pubGet( cwd: tempDirectory.path, recursive: true, ignore: { @@ -218,7 +179,7 @@ void main() { logger.progress( any( that: contains( - '''Running "flutter packages get" in $relativePathPrefix$nestedRelativePath''', + '''Running "dart pub get" in $relativePathPrefix$nestedRelativePath''', ), ), ); @@ -233,7 +194,7 @@ void main() { logger.progress( any( that: contains( - '''Running "flutter packages get" in $relativePathPrefix$ignoredRelativePath''', + '''Running "dart pub get" in $relativePathPrefix$ignoredRelativePath''', ), ), ); @@ -241,55 +202,24 @@ void main() { }); }, ); - }); - - group('.pubGet', () { - test('throws when there is no pubspec.yaml', () { - ProcessOverrides.runZoned( - () => expectLater( - Flutter.pubGet(cwd: Directory.systemTemp.path, logger: logger), - throwsA(isA()), - ), - runProcess: process.run, - ); - }); test('throws when process fails', () { when( () => process.run( - 'flutter', + any(), any(), runInShell: any(named: 'runInShell'), workingDirectory: any(named: 'workingDirectory'), ), ).thenAnswer((_) async => softwareErrorProcessResult); - ProcessOverrides.runZoned( - () => expectLater( - Flutter.pubGet(cwd: Directory.systemTemp.path, logger: logger), - throwsException, - ), - runProcess: process.run, - ); - }); - - test('completes when the process succeeds', () { - ProcessOverrides.runZoned( - () => expectLater(Flutter.pubGet(logger: logger), completes), - runProcess: process.run, - ); - }); - test('completes when the process succeeds (recursive)', () { ProcessOverrides.runZoned( - () => expectLater( - Flutter.pubGet(recursive: true, logger: logger), - completes, - ), + () => expectLater(Flutter.pubGet(logger: logger), throwsException), runProcess: process.run, ); }); - test('throws when process fails', () { + test('throws when process fails (recursive)', () { when( () => process.run( any(), @@ -300,16 +230,25 @@ void main() { ).thenAnswer((_) async => softwareErrorProcessResult); ProcessOverrides.runZoned( - () => expectLater(Flutter.pubGet(logger: logger), throwsException), + () => expectLater( + Flutter.pubGet(recursive: true, logger: logger), + throwsException, + ), runProcess: process.run, ); }); - test('throws when process fails (recursive)', () { + test('throws when there is an unreachable git url', () { + final tempDirectory = Directory.systemTemp.createTempSync(); + addTearDown(() => tempDirectory.deleteSync(recursive: true)); + + File(p.join(tempDirectory.path, 'pubspec.yaml')) + .writeAsStringSync(_unreachableGitUrlPubspec); + when( () => process.run( - any(), - any(), + 'git', + any(that: contains('ls-remote')), runInShell: any(named: 'runInShell'), workingDirectory: any(named: 'workingDirectory'), ), @@ -317,8 +256,8 @@ void main() { ProcessOverrides.runZoned( () => expectLater( - Flutter.pubGet(recursive: true, logger: logger), - throwsException, + () => Flutter.pubGet(cwd: tempDirectory.path, logger: logger), + throwsA(isA()), ), runProcess: process.run, ); diff --git a/test/src/commands/packages/commands/get_test.dart b/test/src/commands/packages/commands/get_test.dart index cd1866ece..fdc9c3bf5 100644 --- a/test/src/commands/packages/commands/get_test.dart +++ b/test/src/commands/packages/commands/get_test.dart @@ -136,7 +136,7 @@ void main() { expect(result, equals(ExitCode.success.code)); verify(() { logger.progress( - any(that: contains('Running "flutter packages get" in')), + any(that: contains('Running "flutter pub get" in')), ); }).called(1); }), @@ -184,7 +184,7 @@ void main() { expect(result, equals(ExitCode.success.code)); verify(() { logger.progress( - any(that: contains('Running "flutter packages get" in')), + any(that: contains('Running "flutter pub get" in')), ); }).called(2); }), @@ -235,7 +235,7 @@ void main() { expect(result, equals(ExitCode.success.code)); verify(() { logger.progress( - any(that: contains('Running "flutter packages get" in')), + any(that: contains('Running "flutter pub get" in')), ); }).called(2); }), @@ -284,7 +284,7 @@ void main() { expect(result, equals(ExitCode.success.code)); verify(() { logger.progress( - any(that: contains('Running "flutter packages get" in')), + any(that: contains('Running "flutter pub get" in')), ); }).called(2); directory.deleteSync(recursive: true); @@ -354,7 +354,7 @@ void main() { logger.progress( any( that: contains( - '''Running "flutter packages get" in $relativePathPrefix$relativePath''', + '''Running "flutter pub get" in $relativePathPrefix$relativePath''', ), ), ); @@ -368,7 +368,7 @@ void main() { logger.progress( any( that: contains( - '''Running "flutter packages get" in $relativePathPrefix$relativePath''', + '''Running "flutter pub get" in $relativePathPrefix$relativePath''', ), ), );