@@ -7,11 +7,7 @@ use mockito::Matcher;
77use tempfile:: { NamedTempFile , TempDir } ;
88
99use cpp_linter:: { logger, rest_client:: RestClient } ;
10- use std:: {
11- env,
12- io:: Write ,
13- path:: { Path , PathBuf } ,
14- } ;
10+ use std:: { env, io:: Write , path:: Path } ;
1511
1612#[ derive( PartialEq , Default ) ]
1713enum EventType {
@@ -36,9 +32,8 @@ const RESET_RATE_LIMIT_HEADER: &str = "x-ratelimit-reset";
3632const REMAINING_RATE_LIMIT_HEADER : & str = "x-ratelimit-remaining" ;
3733const MALFORMED_RESPONSE_PAYLOAD : & str = "{\" message\" :\" Resource not accessible by integration\" }" ;
3834
39- async fn get_paginated_changes ( lib_root : & Path , _tmp_dir : & TempDir , test_params : & TestParams ) {
40- let tmp = TempDir :: new ( ) . expect ( "Failed to create a temp dir for test" ) ;
41- let mut event_payload = NamedTempFile :: new_in ( tmp. path ( ) )
35+ async fn get_paginated_changes ( lib_root : & Path , tmp_dir : & TempDir , test_params : & TestParams ) {
36+ let mut event_payload = NamedTempFile :: new_in ( tmp_dir. path ( ) )
4237 . expect ( "Failed to spawn a tmp file for test event payload" ) ;
4338 unsafe {
4439 env:: set_var ( "GITHUB_ACTIONS" , "true" ) ;
@@ -88,7 +83,6 @@ async fn get_paginated_changes(lib_root: &Path, _tmp_dir: &TempDir, test_params:
8883 unsafe {
8984 env:: set_var ( "GITHUB_API_URL" , server. url ( ) ) ;
9085 }
91- env:: set_current_dir ( tmp. path ( ) ) . unwrap ( ) ;
9286 logger:: try_init ( ) ;
9387 log:: set_max_level ( log:: LevelFilter :: Debug ) ;
9488 let gh_client = RestClient :: new ( ) ;
@@ -149,7 +143,7 @@ async fn get_paginated_changes(lib_root: &Path, _tmp_dir: &TempDir, test_params:
149143 & LinesChangedOnly :: Off ,
150144 & None :: < String > ,
151145 false ,
152- & PathBuf :: from ( "." ) ,
146+ tmp_dir . path ( ) ,
153147 )
154148 . await ;
155149 match files {
0 commit comments