@@ -24,10 +24,7 @@ team_file_glob:
2424"# ;
2525 write_file ( temp_dir. path ( ) , "config/code_ownership.yml" , DEFAULT_CODE_OWNERSHIP_YML ) ;
2626 [ "a" , "b" , "c" ] . iter ( ) . for_each ( |name| {
27- let team_yml = format ! (
28- "name: {}\n github:\n team: \" @{}\" \n members:\n - {}member\n " ,
29- name, name, name
30- ) ;
27+ let team_yml = format ! ( "name: {}\n github:\n team: \" @{}\" \n members:\n - {}member\n " , name, name, name) ;
3128 write_file ( temp_dir. path ( ) , & format ! ( "config/teams/{}.yml" , name) , & team_yml) ;
3229 } ) ;
3330 write_file (
@@ -67,11 +64,8 @@ fn test_teams_for_files_from_codeowners() {
6764 config_path : project_root. join ( "config/code_ownership.yml" ) . to_path_buf ( ) ,
6865 no_cache : true ,
6966 } ;
70- let teams = runner:: teams_for_files_from_codeowners (
71- & run_config,
72- & file_paths. iter ( ) . map ( |s| s. to_string ( ) ) . collect :: < Vec < String > > ( ) ,
73- )
74- . unwrap ( ) ;
67+ let teams =
68+ runner:: teams_for_files_from_codeowners ( & run_config, & file_paths. iter ( ) . map ( |s| s. to_string ( ) ) . collect :: < Vec < String > > ( ) ) . unwrap ( ) ;
7569 assert_eq ! ( teams. len( ) , 5 ) ;
7670 assert_eq ! (
7771 teams
@@ -82,11 +76,7 @@ fn test_teams_for_files_from_codeowners() {
8276 Some ( "Payroll" )
8377 ) ;
8478 assert_eq ! (
85- teams
86- . get( "config/teams/payroll.yml" )
87- . unwrap( )
88- . as_ref( )
89- . map( |t| t. name. as_str( ) ) ,
79+ teams. get( "config/teams/payroll.yml" ) . unwrap( ) . as_ref( ) . map( |t| t. name. as_str( ) ) ,
9080 Some ( "Payroll" )
9181 ) ;
9282 assert_eq ! (
@@ -146,7 +136,11 @@ javascript_package_paths:
146136 let res = runner:: for_team ( & rc, "Foo" ) ;
147137 assert ! ( res. io_errors. is_empty( ) , "unexpected io errors: {:?}" , res. io_errors) ;
148138 assert ! ( res. validation_errors. is_empty( ) ) ;
149- assert ! ( res. info_messages. iter( ) . any( |m| m. contains( "# Code Ownership Report for `Foo` Team" ) ) ) ;
139+ assert ! (
140+ res. info_messages
141+ . iter( )
142+ . any( |m| m. contains( "# Code Ownership Report for `Foo` Team" ) )
143+ ) ;
150144}
151145
152146#[ test]
@@ -185,5 +179,3 @@ javascript_package_paths:
185179 let content = std:: fs:: read_to_string ( td. path ( ) . join ( ".github/CODEOWNERS" ) ) . unwrap ( ) ;
186180 assert ! ( !content. is_empty( ) ) ;
187181}
188-
189-
0 commit comments