Again move mockito to 300plus2 (#15981)

* Revert "Revert "Move mockito to 3.0.0-alpha. (#15949)" (#15979)"

This reverts commit e59651f925.

* More thenReturn to thenAnswer when mocking Futures

* Revert "More thenReturn to thenAnswer when mocking Futures"

This reverts commit 194d2cf41754ad171efd6bb5898cf73bce5a75ab as we are reverting engine roll.

* Revert "Revert "More thenReturn to thenAnswer when mocking Futures""

This reverts commit 52c9e96b304b220f66d78a252fccea0c8e0ef24c.

* Add dependency override

* Fix issue
This commit is contained in:
Alexander Aprelev
2018-03-28 12:07:12 -07:00
committed by GitHub
parent 31049a5a73
commit bffae21571
18 changed files with 29 additions and 28 deletions

View File

@@ -27,6 +27,7 @@ import '../runner/flutter_command.dart';
/// ```
const Map<String, String> _kManuallyPinnedDependencies = const <String, String>{
// Add pinned packages here.
'mockito': '3.0.0-alpha+2', // TODO(aam): https://github.com/dart-lang/mockito/issues/110
};
class UpdatePackagesCommand extends FlutterCommand {

View File

@@ -81,7 +81,7 @@ dependencies:
dev_dependencies:
collection: 1.14.6
mockito: 2.2.3
mockito: 3.0.0-alpha+2
dartdoc:
# Exclude this package from the hosted API docs.

View File

@@ -46,14 +46,14 @@ void main() {
]);
final Process process = new MockProcess();
when(process.stdout).thenReturn(stdout);
when(process.stderr).thenReturn(const Stream<List<int>>.empty());
when(process.exitCode).thenReturn(new Future<int>.value(0));
when(process.stdout).thenAnswer((_) => stdout);
when(process.stderr).thenAnswer((_) => const Stream<List<int>>.empty());
when(process.exitCode).thenAnswer((_) => new Future<int>.value(0));
when(mockProcessManager.start(
<String>['git', 'branch', '-r'],
workingDirectory: typed(any, named: 'workingDirectory'),
environment: typed(any, named: 'environment')))
.thenReturn(new Future<Process>.value(process));
.thenAnswer((_) => new Future<Process>.value(process));
final ChannelCommand command = new ChannelCommand();
final CommandRunner<Null> runner = createTestCommandRunner(command);

View File

@@ -30,7 +30,7 @@ void main() {
when(mockFrontendServer.stderr)
.thenAnswer((Invocation invocation) => mockFrontendServerStdErr);
final StreamController<String> stdErrStreamController = new StreamController<String>();
when(mockFrontendServerStdErr.transform<String>(any)).thenReturn(stdErrStreamController.stream);
when(mockFrontendServerStdErr.transform<String>(any)).thenAnswer((_) => stdErrStreamController.stream);
when(mockFrontendServer.stdin).thenReturn(mockFrontendServerStdIn);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer(