Bump mockito to 3.0.0-beta (#18462)
* Bump mockito to 3.0.0-beta * Few fixes * fix test * Bump image * Fix * New packages update * With matcher pinned * No more typed
This commit is contained in:
committed by
Alexander Aprelev
parent
bec912165a
commit
9f8a70be4c
@@ -65,7 +65,7 @@ dependencies:
|
||||
yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
|
||||
dev_dependencies:
|
||||
mockito: 3.0.0-alpha+5
|
||||
mockito: 3.0.0-beta
|
||||
test: 0.12.41
|
||||
|
||||
# PUBSPEC CHECKSUM: 6256
|
||||
# PUBSPEC CHECKSUM: 4e8b
|
||||
|
||||
@@ -20,7 +20,7 @@ void main() {
|
||||
setUp(() {
|
||||
mockRunner = new MockSshCommandRunner();
|
||||
// Adds some extra junk to make sure the strings will be cleaned up.
|
||||
when(mockRunner.run(typed(any))).thenAnswer((_) =>
|
||||
when(mockRunner.run(any)).thenAnswer((_) =>
|
||||
new Future<List<String>>.value(
|
||||
<String>['123\n\n\n', '456 ', '789']));
|
||||
const String address = 'fe80::8eae:4cff:fef4:9247';
|
||||
@@ -90,7 +90,7 @@ void main() {
|
||||
final MockPeer mp = new MockPeer();
|
||||
mockPeerConnections.add(mp);
|
||||
uriConnections.add(uri);
|
||||
when(mp.sendRequest(typed<String>(any), typed<String>(any)))
|
||||
when(mp.sendRequest(any, any))
|
||||
// The local ports match the desired indices for now, so get the
|
||||
// canned response from the URI port.
|
||||
.thenAnswer((_) => new Future<Map<String, dynamic>>(
|
||||
|
||||
@@ -84,8 +84,7 @@ void main() {
|
||||
};
|
||||
|
||||
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
|
||||
when(mockPeer.sendRequest(
|
||||
typed<String>(any), typed<Map<String, dynamic>>(any)))
|
||||
when(mockPeer.sendRequest(any, any))
|
||||
.thenAnswer((_) => new Future<Map<String, dynamic>>(
|
||||
() => flutterViewCannedResponses));
|
||||
return new Future<json_rpc.Peer>(() => mockPeer);
|
||||
@@ -133,8 +132,7 @@ void main() {
|
||||
};
|
||||
|
||||
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
|
||||
when(mockPeer.sendRequest(
|
||||
typed<String>(any), typed<Map<String, dynamic>>(any)))
|
||||
when(mockPeer.sendRequest(any, any))
|
||||
.thenAnswer((_) => new Future<Map<String, dynamic>>(
|
||||
() => flutterViewCannedResponseMissingId));
|
||||
return new Future<json_rpc.Peer>(() => mockPeer);
|
||||
@@ -171,8 +169,7 @@ void main() {
|
||||
};
|
||||
|
||||
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
|
||||
when(mockPeer.sendRequest(
|
||||
typed<String>(any), typed<Map<String, dynamic>>(any)))
|
||||
when(mockPeer.sendRequest(any, any))
|
||||
.thenAnswer((_) => new Future<Map<String, dynamic>>(
|
||||
() => flutterViewCannedResponseMissingIsolateName));
|
||||
return new Future<json_rpc.Peer>(() => mockPeer);
|
||||
@@ -206,8 +203,7 @@ void main() {
|
||||
const Duration timeoutTime = const Duration(milliseconds: 100);
|
||||
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
|
||||
// Return a command that will never complete.
|
||||
when(mockPeer.sendRequest(
|
||||
typed<String>(any), typed<Map<String, dynamic>>(any)))
|
||||
when(mockPeer.sendRequest(any, any))
|
||||
.thenAnswer((_) => new Completer<Map<String, dynamic>>().future);
|
||||
return new Future<json_rpc.Peer>(() => mockPeer);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void main() {
|
||||
setUp(() {
|
||||
mockProcessManager = new MockProcessManager();
|
||||
mockProcessResult = new MockProcessResult();
|
||||
when(mockProcessManager.run(typed(any))).thenAnswer(
|
||||
when(mockProcessManager.run(any)).thenAnswer(
|
||||
(_) => new Future<MockProcessResult>.value(mockProcessResult));
|
||||
});
|
||||
|
||||
@@ -57,7 +57,7 @@ void main() {
|
||||
when(mockProcessResult.exitCode).thenReturn(0);
|
||||
await runner.run('ls /whatever');
|
||||
final List<String> passedCommand =
|
||||
verify(mockProcessManager.run(typed(captureAny))).captured.single;
|
||||
verify(mockProcessManager.run(captureAny)).captured.single;
|
||||
expect(passedCommand, contains('$ipV6Addr%$interface'));
|
||||
});
|
||||
|
||||
@@ -72,7 +72,7 @@ void main() {
|
||||
when(mockProcessResult.exitCode).thenReturn(0);
|
||||
await runner.run('ls /whatever');
|
||||
final List<String> passedCommand =
|
||||
verify(mockProcessManager.run(typed(captureAny))).captured.single;
|
||||
verify(mockProcessManager.run(captureAny)).captured.single;
|
||||
expect(passedCommand, contains(ipV6Addr));
|
||||
});
|
||||
|
||||
@@ -114,7 +114,7 @@ void main() {
|
||||
when(mockProcessResult.exitCode).thenReturn(0);
|
||||
await runner.run('ls /whatever');
|
||||
final List<String> passedCommand =
|
||||
verify(mockProcessManager.run(typed(captureAny))).captured.single;
|
||||
verify(mockProcessManager.run(captureAny)).captured.single;
|
||||
expect(passedCommand, contains('-F'));
|
||||
final int indexOfFlag = passedCommand.indexOf('-F');
|
||||
final String passedConfig = passedCommand[indexOfFlag + 1];
|
||||
@@ -131,7 +131,7 @@ void main() {
|
||||
when(mockProcessResult.exitCode).thenReturn(0);
|
||||
await runner.run('ls /whatever');
|
||||
final List<String> passedCommand =
|
||||
verify(mockProcessManager.run(typed(captureAny))).captured.single;
|
||||
verify(mockProcessManager.run(captureAny)).captured.single;
|
||||
final int indexOfFlag = passedCommand.indexOf('-F');
|
||||
expect(indexOfFlag, equals(-1));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user