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
389e13f8
Unverified
Commit
389e13f8
authored
Dec 06, 2017
by
Greg Spencer
Committed by
GitHub
Dec 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing the pub get test so that it doesn't care what the flutter root looks like. (#13385)
parent
99987c22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
pub_get_test.dart
packages/flutter_tools/test/dart/pub_get_test.dart
+11
-4
No files found.
packages/flutter_tools/test/dart/pub_get_test.dart
View file @
389e13f8
...
...
@@ -6,6 +6,7 @@ import 'dart:async';
import
'package:file/file.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/base/context.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
...
...
@@ -16,9 +17,14 @@ import 'package:process/process.dart';
import
'package:quiver/testing/async.dart'
;
import
'package:test/test.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
void
main
(
)
{
setUpAll
(()
{
Cache
.
flutterRoot
=
getFlutterRoot
();
});
testUsingContext
(
'pub get 69'
,
()
async
{
String
error
;
...
...
@@ -91,6 +97,7 @@ void main() {
String
error
;
final
MockProcessManager
processMock
=
context
.
getVariable
(
ProcessManager
);
final
MockFileSystem
fsMock
=
context
.
getVariable
(
FileSystem
);
new
FakeAsync
().
run
((
FakeAsync
time
)
{
MockDirectory
.
findCache
=
true
;
...
...
@@ -102,7 +109,7 @@ void main() {
error
=
'test failed unexpectedly:
$thrownError
'
;
});
time
.
elapse
(
const
Duration
(
milliseconds:
500
));
expect
(
processMock
.
lastPubCache
,
e
ndsWith
(
'flutter/.pub-cache'
));
expect
(
processMock
.
lastPubCache
,
e
quals
(
fsMock
.
path
.
join
(
Cache
.
flutterRoot
,
'.pub-cache'
)
));
expect
(
error
,
isNull
);
});
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -119,7 +126,7 @@ void main() {
final
MockProcessManager
processMock
=
context
.
getVariable
(
ProcessManager
);
new
FakeAsync
().
run
((
FakeAsync
time
)
{
MockDirectory
.
findCache
=
fals
e
;
MockDirectory
.
findCache
=
tru
e
;
expect
(
processMock
.
lastPubEnvironmment
,
isNull
);
expect
(
processMock
.
lastPubCache
,
isNull
);
pubGet
(
context:
PubContext
.
flutterTests
,
checkLastModified:
false
).
then
((
Null
value
)
{
...
...
@@ -128,14 +135,14 @@ void main() {
error
=
'test failed unexpectedly:
$thrownError
'
;
});
time
.
elapse
(
const
Duration
(
milliseconds:
500
));
expect
(
processMock
.
lastPubCache
,
equals
(
'
path/to/pub-cache
'
));
expect
(
processMock
.
lastPubCache
,
equals
(
'
custom/pub-cache/path
'
));
expect
(
error
,
isNull
);
});
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
new
MockProcessManager
(
69
),
FileSystem:
()
=>
new
MockFileSystem
(),
Platform:
()
=>
new
FakePlatform
(
environment:
<
String
,
String
>{
'PUB_CACHE'
:
'
path/to/pub-cache
'
},
environment:
<
String
,
String
>{
'PUB_CACHE'
:
'
custom/pub-cache/path
'
},
),
});
}
...
...
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