Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1f76f7f9
Commit
1f76f7f9
authored
May 16, 2018
by
Sam Rawlins
Committed by
Alexander Aprelev
May 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate to Mockito 3's anyNamed (#17632)
parent
20512d45
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
consolidate_response_test.dart
...es/flutter/test/foundation/consolidate_response_test.dart
+7
-7
channel_test.dart
packages/flutter_tools/test/channel_test.dart
+5
-5
cocoapods_test.dart
packages/flutter_tools/test/ios/cocoapods_test.dart
+3
-3
No files found.
packages/flutter/test/foundation/consolidate_response_test.dart
View file @
1f76f7f9
...
@@ -15,9 +15,9 @@ void main() {
...
@@ -15,9 +15,9 @@ void main() {
response
=
new
MockHttpClientResponse
();
response
=
new
MockHttpClientResponse
();
when
(
response
.
listen
(
when
(
response
.
listen
(
typed
(
any
),
typed
(
any
),
onDone:
typed
(
any
,
named:
'onDone'
),
onDone:
anyNamed
(
'onDone'
),
onError:
typed
(
any
,
named:
'onError'
),
onError:
anyNamed
(
'onError'
),
cancelOnError:
typed
(
any
,
named:
'cancelOnError'
)
cancelOnError:
anyNamed
(
'cancelOnError'
)
)).
thenAnswer
((
Invocation
invocation
)
{
)).
thenAnswer
((
Invocation
invocation
)
{
final
void
Function
(
List
<
int
>)
onData
=
invocation
.
positionalArguments
[
0
];
final
void
Function
(
List
<
int
>)
onData
=
invocation
.
positionalArguments
[
0
];
final
void
Function
(
Object
)
onError
=
invocation
.
namedArguments
[
#onError
];
final
void
Function
(
Object
)
onError
=
invocation
.
namedArguments
[
#onError
];
...
@@ -46,9 +46,9 @@ void main() {
...
@@ -46,9 +46,9 @@ void main() {
test
(
'forwards errors from HttpClientResponse'
,
()
async
{
test
(
'forwards errors from HttpClientResponse'
,
()
async
{
when
(
response
.
listen
(
when
(
response
.
listen
(
typed
(
any
),
typed
(
any
),
onDone:
typed
(
any
,
named:
'onDone'
),
onDone:
anyNamed
(
'onDone'
),
onError:
typed
(
any
,
named:
'onError'
),
onError:
anyNamed
(
'onError'
),
cancelOnError:
typed
(
any
,
named:
'cancelOnError'
)
cancelOnError:
anyNamed
(
'cancelOnError'
)
)).
thenAnswer
((
Invocation
invocation
)
{
)).
thenAnswer
((
Invocation
invocation
)
{
final
void
Function
(
List
<
int
>)
onData
=
invocation
.
positionalArguments
[
0
];
final
void
Function
(
List
<
int
>)
onData
=
invocation
.
positionalArguments
[
0
];
final
void
Function
(
Object
)
onError
=
invocation
.
namedArguments
[
#onError
];
final
void
Function
(
Object
)
onError
=
invocation
.
namedArguments
[
#onError
];
...
@@ -65,4 +65,4 @@ void main() {
...
@@ -65,4 +65,4 @@ void main() {
});
});
}
}
class
MockHttpClientResponse
extends
Mock
implements
HttpClientResponse
{}
class
MockHttpClientResponse
extends
Mock
implements
HttpClientResponse
{}
\ No newline at end of file
packages/flutter_tools/test/channel_test.dart
View file @
1f76f7f9
...
@@ -51,8 +51,8 @@ void main() {
...
@@ -51,8 +51,8 @@ void main() {
when
(
process
.
exitCode
).
thenAnswer
((
_
)
=>
new
Future
<
int
>.
value
(
0
));
when
(
process
.
exitCode
).
thenAnswer
((
_
)
=>
new
Future
<
int
>.
value
(
0
));
when
(
mockProcessManager
.
start
(
when
(
mockProcessManager
.
start
(
<
String
>[
'git'
,
'branch'
,
'-r'
],
<
String
>[
'git'
,
'branch'
,
'-r'
],
workingDirectory:
typed
(
any
,
named:
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
typed
(
any
,
named:
'environment'
)))
environment:
anyNamed
(
'environment'
)))
.
thenAnswer
((
_
)
=>
new
Future
<
Process
>.
value
(
process
));
.
thenAnswer
((
_
)
=>
new
Future
<
Process
>.
value
(
process
));
final
ChannelCommand
command
=
new
ChannelCommand
();
final
ChannelCommand
command
=
new
ChannelCommand
();
...
@@ -60,8 +60,8 @@ void main() {
...
@@ -60,8 +60,8 @@ void main() {
await
runner
.
run
(<
String
>[
'channel'
]);
await
runner
.
run
(<
String
>[
'channel'
]);
verify
(
mockProcessManager
.
start
(<
String
>[
'git'
,
'branch'
,
'-r'
],
verify
(
mockProcessManager
.
start
(<
String
>[
'git'
,
'branch'
,
'-r'
],
workingDirectory:
typed
(
any
,
named:
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
typed
(
any
,
named:
'environment'
))).
called
(
1
);
environment:
anyNamed
(
'environment'
))).
called
(
1
);
expect
(
testLogger
.
errorText
,
hasLength
(
0
));
expect
(
testLogger
.
errorText
,
hasLength
(
0
));
...
@@ -81,4 +81,4 @@ void main() {
...
@@ -81,4 +81,4 @@ void main() {
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcess
extends
Mock
implements
Process
{}
class
MockProcess
extends
Mock
implements
Process
{}
\ No newline at end of file
packages/flutter_tools/test/ios/cocoapods_test.dart
View file @
1f76f7f9
...
@@ -206,7 +206,7 @@ void main() {
...
@@ -206,7 +206,7 @@ void main() {
verifyNever
(
mockProcessManager
.
run
(
verifyNever
(
mockProcessManager
.
run
(
argThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
argThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
workingDirectory:
any
,
workingDirectory:
any
,
environment:
typed
<
Map
<
String
,
String
>>(
any
,
named:
'environment'
),
environment:
anyNamed
(
'environment'
),
));
));
expect
(
testLogger
.
errorText
,
contains
(
'not installed'
));
expect
(
testLogger
.
errorText
,
contains
(
'not installed'
));
expect
(
testLogger
.
errorText
,
contains
(
'Skipping pod install'
));
expect
(
testLogger
.
errorText
,
contains
(
'Skipping pod install'
));
...
@@ -228,7 +228,7 @@ void main() {
...
@@ -228,7 +228,7 @@ void main() {
verifyNever
(
mockProcessManager
.
run
(
verifyNever
(
mockProcessManager
.
run
(
argThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
argThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
workingDirectory:
any
,
workingDirectory:
any
,
environment:
typed
<
Map
<
String
,
String
>>(
any
,
named:
'environment'
),
environment:
anyNamed
(
'environment'
),
));
));
}
}
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
...
@@ -439,7 +439,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
...
@@ -439,7 +439,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
verifyNever
(
mockProcessManager
.
run
(
verifyNever
(
mockProcessManager
.
run
(
argThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
argThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
workingDirectory:
any
,
workingDirectory:
any
,
environment:
typed
<
Map
<
String
,
String
>>(
any
,
named:
'environment'
),
environment:
anyNamed
(
'environment'
),
));
));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment