File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
crates/cargo-test-support/src Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1163,6 +1163,7 @@ pub trait TestEnv: Sized {
1163
1163
}
1164
1164
1165
1165
self = self
1166
+ . current_dir ( & paths:: root ( ) )
1166
1167
. env ( "HOME" , paths:: home ( ) )
1167
1168
. env ( "CARGO_HOME" , paths:: home ( ) . join ( ".cargo" ) )
1168
1169
. env ( "__CARGO_TEST_ROOT" , paths:: root ( ) )
@@ -1198,11 +1199,16 @@ pub trait TestEnv: Sized {
1198
1199
self
1199
1200
}
1200
1201
1202
+ fn current_dir < S : AsRef < std:: path:: Path > > ( self , path : S ) -> Self ;
1201
1203
fn env < S : AsRef < std:: ffi:: OsStr > > ( self , key : & str , value : S ) -> Self ;
1202
1204
fn env_remove ( self , key : & str ) -> Self ;
1203
1205
}
1204
1206
1205
1207
impl TestEnv for & mut ProcessBuilder {
1208
+ fn current_dir < S : AsRef < std:: path:: Path > > ( self , path : S ) -> Self {
1209
+ let path = path. as_ref ( ) ;
1210
+ self . cwd ( path)
1211
+ }
1206
1212
fn env < S : AsRef < std:: ffi:: OsStr > > ( self , key : & str , value : S ) -> Self {
1207
1213
self . env ( key, value)
1208
1214
}
@@ -1212,6 +1218,9 @@ impl TestEnv for &mut ProcessBuilder {
1212
1218
}
1213
1219
1214
1220
impl TestEnv for snapbox:: cmd:: Command {
1221
+ fn current_dir < S : AsRef < std:: path:: Path > > ( self , path : S ) -> Self {
1222
+ self . current_dir ( path)
1223
+ }
1215
1224
fn env < S : AsRef < std:: ffi:: OsStr > > ( self , key : & str , value : S ) -> Self {
1216
1225
self . env ( key, value)
1217
1226
}
You can’t perform that action at this time.
0 commit comments