Fix typo in create.dart (#82454)

This commit is contained in:
Alex Melnyk
2021-06-09 01:58:01 +03:00
committed by GitHub
parent 3bd14e7869
commit 23d705c30b
2 changed files with 20 additions and 1 deletions

View File

@@ -483,7 +483,7 @@ void _printPluginDirectoryLocationMessage(String pluginPath, String projectName,
Your plugin code is in $relativePluginMain.
You example app code is in $relativeExampleMain.
Your example app code is in $relativeExampleMain.
''');
if (platformsString != null && platformsString.isNotEmpty) {

View File

@@ -2203,6 +2203,25 @@ void main() {
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
});
testUsingContext('flutter create . on and existing plugin should show "Your example app code in"', () async {
Cache.flutterRoot = '../..';
final CreateCommand command = CreateCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
final String projectDirPath = globals.fs.path.normalize(projectDir.absolute.path);
final String relativePluginPath = globals.fs.path.normalize(globals.fs.path.relative(projectDirPath));
final String relativeExamplePath = globals.fs.path.normalize(globals.fs.path.join(relativePluginPath, 'example/lib/main.dart'));
await runner.run(<String>['create', '--no-pub', '--org=com.example', '--template=plugin', '--platforms=android', projectDir.path]);
expect(logger.statusText, contains('Your example app code is in $relativeExamplePath.\n'));
await runner.run(<String>['create', '--no-pub', '--org=com.example', '--template=plugin', '--platforms=ios', projectDir.path]);
expect(logger.statusText, contains('Your example app code is in $relativeExamplePath.\n'));
await runner.run(<String>['create', '--no-pub', projectDir.path]);
expect(logger.statusText, contains('Your example app code is in $relativeExamplePath.\n'));
}, overrides: <Type, Generator> {
Logger: () => logger,
});
testUsingContext('flutter create -t plugin in an empty folder should not show pubspec.yaml updating suggestion', () async {
Cache.flutterRoot = '../..';