@@ -14,23 +14,19 @@ final _webdevBin = p.absolute('bin/webdev.dart');
14
14
void main () {
15
15
test ('README contains help output' , () async {
16
16
var process = await TestProcess .start ('dart' , [_webdevBin]);
17
-
18
17
var output = (await process.stdoutStream ().join ('\n ' )).trim ();
18
+ await process.shouldExit (0 );
19
19
20
20
var readme = new File ('README.md' );
21
-
22
21
expect (readme.readAsStringSync (),
23
22
contains ('```console\n\$ webdev\n $output \n ```' ));
24
-
25
- await process.shouldExit (0 );
26
23
});
27
24
28
25
test ('non-existant commands create errors' , () async {
29
26
var process = await TestProcess .start ('dart' , [_webdevBin, 'monkey' ]);
30
27
31
- var output = (await process.stdoutStream ().join ('\n ' )).trim ();
32
-
33
- expect (output, contains ('Could not find a command named "monkey".' ));
28
+ await expectLater (
29
+ process.stdout, emits ('Could not find a command named "monkey".' ));
34
30
35
31
await process.shouldExit (64 );
36
32
});
@@ -63,12 +59,12 @@ packages:
63
59
64
60
var process = await TestProcess .start ('dart' , [_webdevBin, 'build' ],
65
61
workingDirectory: d.sandbox);
66
- var output = (await process.stdoutStream ().join ('\n ' )).trim ();
67
62
68
- expect (output, contains ('Could not run in the current directory.' ));
69
- expect (
70
- output,
71
- contains ('The `build_runner` version – $version – '
63
+ await expectLater (
64
+ process.stdout, emits ('Could not run in the current directory.' ));
65
+ await expectLater (
66
+ process.stdout,
67
+ emits ('The `build_runner` version – $version – '
72
68
'is not within the supported range – >=0.8.0 <0.9.0.' ));
73
69
await process.shouldExit (78 );
74
70
});
@@ -90,11 +86,11 @@ packages:
90
86
91
87
var process = await TestProcess .start ('dart' , [_webdevBin, 'build' ],
92
88
workingDirectory: d.sandbox);
93
- var output = (await process.stdoutStream ().join ('\n ' )).trim ();
94
89
95
- expect (output, contains ('Could not run in the current directory.' ));
96
- expect (output,
97
- contains ('A dependency on `build_web_compilers` was not found.' ));
90
+ await expectLater (
91
+ process.stdout, emits ('Could not run in the current directory.' ));
92
+ await expectLater (process.stdout,
93
+ emits ('A dependency on `build_web_compilers` was not found.' ));
98
94
await process.shouldExit (78 );
99
95
});
100
96
@@ -120,11 +116,11 @@ packages:
120
116
121
117
var process = await TestProcess .start ('dart' , [_webdevBin, 'build' ],
122
118
workingDirectory: d.sandbox);
123
- var output = (await process.stdoutStream ().join ('\n ' )).trim ();
124
119
125
- expect (output, contains ('Could not run in the current directory.' ));
126
- expect (output,
127
- contains ('A `.packages` file does not exist in the target directory.' ));
120
+ await expectLater (
121
+ process.stdout, emits ('Could not run in the current directory.' ));
122
+ await expectLater (process.stdout,
123
+ emits ('A `.packages` file does not exist in the target directory.' ));
128
124
await process.shouldExit (78 );
129
125
});
130
126
@@ -152,9 +148,9 @@ packages:
152
148
153
149
var process = await TestProcess .start ('dart' , [_webdevBin, 'build' ],
154
150
workingDirectory: d.sandbox);
155
- var output = (await process.stdoutStream ().join ('\n ' )).trim ();
156
151
157
- expect (output, contains ('An unexpected exception has occurred.' ));
152
+ await expectLater (
153
+ process.stdout, emits ('An unexpected exception has occurred.' ));
158
154
await process.shouldExit (70 );
159
155
});
160
156
}
0 commit comments