11use std:: path:: PathBuf ;
22use std:: { thread, time} ;
33
4- use crate :: support:: events_helpers:: { assert_events, match_end, match_error, match_start} ;
4+ use crate :: support:: events_helpers:: {
5+ assert_events, match_args, match_end, match_error, match_start,
6+ } ;
57use crate :: support:: sandbox:: sandbox;
68use hamcrest2:: assert_that;
79use hamcrest2:: prelude:: * ;
@@ -155,16 +157,14 @@ fn redirects_download() {
155157 assert_events (
156158 & s,
157159 vec ! [
158- (
159- "volta" ,
160- match_start
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 161- ) ,
162- (
163- "install" ,
164- match_start
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 165- ) ,
160+ ( "volta" , match_start( ) ) ,
161+ ( "install" , match_start( ) ) ,
166162 ( "volta" , match_error( 5 , "Could not download node" ) ) ,
167163 ( "volta" , match_end( 5 ) ) ,
164+ (
165+ "args" ,
166+ match_args
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 167+ ) ,
168168 ] ,
169169 ) ;
170170}
@@ -192,16 +192,14 @@ fn merges_project_and_default_hooks() {
192192 assert_events (
193193 & s,
194194 vec ! [
195- (
196- "volta" ,
197- match_start
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 198- ) ,
199- (
200- "install" ,
201- match_start
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 202- ) ,
195+ ( "volta" , match_start( ) ) ,
196+ ( "install" , match_start( ) ) ,
203197 ( "volta" , match_error( 5 , "Could not download yarn" ) ) ,
204198 ( "volta" , match_end( 5 ) ) ,
199+ (
200+ "args" ,
201+ match_args
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 202+ ) ,
205203 ] ,
206204 ) ;
207205
@@ -217,16 +215,14 @@ fn merges_project_and_default_hooks() {
217215 assert_events (
218216 & s,
219217 vec ! [
220- (
221- "volta" ,
222- match_start
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 223- ) ,
224- (
225- "install" ,
226- match_start
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 227- ) ,
218+ ( "volta" , match_start( ) ) ,
219+ ( "install" , match_start( ) ) ,
228220 ( "volta" , match_error( 5 , "Could not download node" ) ) ,
229221 ( "volta" , match_end( 5 ) ) ,
222+ (
223+ "args" ,
224+ match_args
( format!
( "{} install [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 225+ ) ,
230226 ] ,
231227 ) ;
232228}
@@ -261,16 +257,14 @@ fn merges_workspace_hooks() {
261257 assert_events (
262258 & s,
263259 vec ! [
264- (
265- "volta" ,
266- match_start
( format!
( "{} pin [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 267- ) ,
268- (
269- "pin" ,
270- match_start
( format!
( "{} pin [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 271- ) ,
260+ ( "volta" , match_start( ) ) ,
261+ ( "pin" , match_start( ) ) ,
272262 ( "volta" , match_error( 5 , "Could not download yarn" ) ) ,
273263 ( "volta" , match_end( 5 ) ) ,
264+ (
265+ "args" ,
266+ match_args
( format!
( "{} pin [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 267+ ) ,
274268 ] ,
275269 ) ;
276270
@@ -286,16 +280,14 @@ fn merges_workspace_hooks() {
286280 assert_events (
287281 & s,
288282 vec ! [
289- (
290- "volta" ,
291- match_start
( format!
( "{} pin [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 292- ) ,
293- (
294- "pin" ,
295- match_start
( format!
( "{} pin [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 296- ) ,
283+ ( "volta" , match_start( ) ) ,
284+ ( "pin" , match_start( ) ) ,
297285 ( "volta" , match_error( 5 , "Could not download npm" ) ) ,
298286 ( "volta" , match_end( 5 ) ) ,
287+ (
288+ "args" ,
289+ match_args
( format!
( "{} pin [email protected] " , VOLTA_BINARY ) . as_str
( ) ) , 290+ ) ,
299291 ] ,
300292 ) ;
301293
0 commit comments