File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
crates/snm_test_utils/src Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11use std:: {
22 collections:: HashMap ,
3- env:: { self } ,
3+ env:: { self , current_dir } ,
44 fs,
55 path:: PathBuf ,
66} ;
@@ -25,6 +25,7 @@ pub struct SnmTestContext {
2525 id : String ,
2626 name : String ,
2727 counter : usize ,
28+ cwd : String ,
2829 temp_dir : PathBuf ,
2930 env_vars : HashMap < String , String > ,
3031 snapshots : Vec < String > ,
@@ -36,10 +37,13 @@ impl AsyncTestContext for SnmTestContext {
3637
3738 let env_vars = Self :: setup_env_vars ( ) ;
3839
40+ let cwd = current_dir ( ) . unwrap ( ) ;
41+
3942 Self {
4043 id : uuid:: Uuid :: new_v4 ( ) . to_string ( ) ,
4144 name : "" . to_string ( ) ,
4245 counter : 0 ,
46+ cwd : cwd. to_string_lossy ( ) . to_string ( ) ,
4347 temp_dir : temp_dir. into_path ( ) ,
4448 env_vars,
4549 snapshots : vec ! [ ] ,
@@ -90,7 +94,7 @@ impl SnmTestContext {
9094 }
9195
9296 pub fn cwd ( & mut self , path : & PathBuf ) {
93- self . temp_dir = path. to_owned ( ) ;
97+ self . cwd = path. to_string_lossy ( ) . to_string ( ) ;
9498 }
9599
96100 pub fn vars ( & mut self , envs : & [ ( String , String ) ] ) {
You can’t perform that action at this time.
0 commit comments