mirror of
https://github.com/flutter/packages.git
synced 2025-07-08 03:46:19 +08:00
[tools] Convert test utils to RepositoryPackage (#5605)
This commit is contained in:
script/tool
lib/src
common
create_all_plugins_app_command.dartfirebase_test_lab_command.dartlint_android_command.dartmake_deps_path_based_command.dartnative_test_command.dartpublish_check_command.darttest_command.dartversion_check_command.darttest
analyze_command_test.dartbuild_examples_command_test.dart
common
gradle_test.dartpackage_looping_command_test.dartplugin_command_test.dartplugin_utils_test.dartrepository_package_test.dart
create_all_plugins_app_command_test.dartcustom_test_command_test.dartdrive_examples_command_test.dartfederation_safety_check_command_test.dartfirebase_test_lab_command_test.dartformat_command_test.dartlint_android_command_test.dartlint_podspecs_command_test.dartlist_command_test.dartmake_deps_path_based_command_test.dartnative_test_command_test.dartpublish_check_command_test.dartpublish_plugin_command_test.dartpubspec_check_command_test.dartreadme_check_command_test.darttest_command_test.dartupdate_excerpts_command_test.dartutil.dartversion_check_command_test.dartxcode_analyze_command_test.dart@ -7,7 +7,6 @@ import 'dart:io' as io;
|
||||
import 'package:args/command_runner.dart';
|
||||
import 'package:file/file.dart';
|
||||
import 'package:file/local.dart';
|
||||
import 'package:flutter_plugin_tools/src/common/repository_package.dart';
|
||||
import 'package:flutter_plugin_tools/src/create_all_plugins_app_command.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
import 'package:test/test.dart';
|
||||
@ -49,8 +48,7 @@ void main() {
|
||||
createFakePlugin('pluginc', packagesDir);
|
||||
|
||||
await runCapturingPrint(runner, <String>['all-plugins-app']);
|
||||
final List<String> pubspec =
|
||||
command.appDirectory.childFile('pubspec.yaml').readAsLinesSync();
|
||||
final List<String> pubspec = command.app.pubspecFile.readAsLinesSync();
|
||||
|
||||
expect(
|
||||
pubspec,
|
||||
@ -67,8 +65,7 @@ void main() {
|
||||
createFakePlugin('pluginc', packagesDir);
|
||||
|
||||
await runCapturingPrint(runner, <String>['all-plugins-app']);
|
||||
final List<String> pubspec =
|
||||
command.appDirectory.childFile('pubspec.yaml').readAsLinesSync();
|
||||
final List<String> pubspec = command.app.pubspecFile.readAsLinesSync();
|
||||
|
||||
expect(
|
||||
pubspec,
|
||||
@ -99,8 +96,7 @@ void main() {
|
||||
createFakePlugin('plugina', packagesDir);
|
||||
|
||||
await runCapturingPrint(runner, <String>['all-plugins-app']);
|
||||
final Pubspec generatedPubspec =
|
||||
RepositoryPackage(command.appDirectory).parsePubspec();
|
||||
final Pubspec generatedPubspec = command.app.parsePubspec();
|
||||
|
||||
const String dartSdkKey = 'sdk';
|
||||
expect(generatedPubspec.environment?[dartSdkKey],
|
||||
@ -115,8 +111,8 @@ void main() {
|
||||
await runCapturingPrint(runner,
|
||||
<String>['all-plugins-app', '--output-dir=${customOutputDir.path}']);
|
||||
|
||||
expect(command.appDirectory.path,
|
||||
customOutputDir.childDirectory('all_plugins').path);
|
||||
expect(
|
||||
command.app.path, customOutputDir.childDirectory('all_plugins').path);
|
||||
});
|
||||
|
||||
test('logs exclusions', () async {
|
||||
|
Reference in New Issue
Block a user