@@ -14,16 +14,13 @@ import 'package:flutter_plugin_tools/src/publish_command.dart';
1414import 'package:http/http.dart' as http;
1515import 'package:http/testing.dart' ;
1616import 'package:mockito/mockito.dart' ;
17- import 'package:platform/platform.dart' ;
1817import 'package:test/test.dart' ;
1918
2019import 'common/package_command_test.mocks.dart' ;
2120import 'mocks.dart' ;
2221import 'util.dart' ;
2322
2423void main () {
25- final String flutterCommand = getFlutterCommand (const LocalPlatform ());
26-
2724 late MockPlatform platform;
2825 late Directory packagesDir;
2926 late MockGitDir gitDir;
@@ -149,8 +146,7 @@ void main() {
149146 createFakePlugin ('plugin1' , packagesDir, examples: < String > []);
150147 createFakePlugin ('plugin2' , packagesDir, examples: < String > []);
151148
152- processRunner.mockProcessesForExecutable[flutterCommand] =
153- < FakeProcessInfo > [
149+ processRunner.mockProcessesForExecutable['flutter' ] = < FakeProcessInfo > [
154150 FakeProcessInfo (
155151 MockProcess (
156152 stdout: 'Foo' ,
@@ -206,7 +202,7 @@ void main() {
206202 expect (
207203 processRunner.recordedCalls,
208204 contains (ProcessCall (
209- flutterCommand ,
205+ 'flutter' ,
210206 const < String > ['pub' , 'publish' , '--dry-run' , '--server=bar' ],
211207 plugin.path)));
212208 });
@@ -229,7 +225,7 @@ void main() {
229225 expect (
230226 processRunner.recordedCalls,
231227 contains (ProcessCall (
232- flutterCommand ,
228+ 'flutter' ,
233229 const < String > ['pub' , 'publish' , '--server=bar' , '--force' ],
234230 plugin.path)));
235231 });
@@ -253,11 +249,11 @@ void main() {
253249 processRunner.recordedCalls,
254250 containsAllInOrder (< ProcessCall > [
255251 ProcessCall (
256- flutterCommand ,
252+ 'flutter' ,
257253 const < String > ['pub' , 'publish' , '--server=bar' , '--force' ],
258254 plugin1.path),
259255 ProcessCall (
260- flutterCommand ,
256+ 'flutter' ,
261257 const < String > ['pub' , 'publish' , '--server=bar' , '--force' ],
262258 plugin2.path),
263259 ]));
@@ -285,8 +281,7 @@ void main() {
285281 test ('throws if pub publish fails' , () async {
286282 createFakePlugin ('foo' , packagesDir, examples: < String > []);
287283
288- processRunner.mockProcessesForExecutable[flutterCommand] =
289- < FakeProcessInfo > [
284+ processRunner.mockProcessesForExecutable['flutter' ] = < FakeProcessInfo > [
290285 FakeProcessInfo (MockProcess (exitCode: 128 ), < String > ['pub' , 'publish' ])
291286 ];
292287
@@ -371,8 +366,7 @@ void main() {
371366 test ('only if publishing succeeded' , () async {
372367 createFakePlugin ('foo' , packagesDir, examples: < String > []);
373368
374- processRunner.mockProcessesForExecutable[flutterCommand] =
375- < FakeProcessInfo > [
369+ processRunner.mockProcessesForExecutable['flutter' ] = < FakeProcessInfo > [
376370 FakeProcessInfo (MockProcess (exitCode: 128 ), < String > ['pub' , 'publish' ]),
377371 ];
378372
@@ -954,7 +948,7 @@ class TestProcessRunner extends RecordingProcessRunner {
954948 {Directory ? workingDirectory}) async {
955949 final io.Process process =
956950 await super .start (executable, args, workingDirectory: workingDirectory);
957- if (executable == getFlutterCommand ( const LocalPlatform ()) &&
951+ if (executable == 'flutter' &&
958952 args.isNotEmpty &&
959953 args[0 ] == 'pub' &&
960954 args[1 ] == 'publish' ) {
0 commit comments