@@ -47,8 +47,8 @@ def testCheckAndGenerateEmptyThirdPartyProvider_whenFileAlreadyExists_doNothing(
4747
4848 # Arrange
4949 FileMock . mocked_existing_files ( [
50- @prefix + "/React/Fabric/" + @third_party_provider_header ,
51- @prefix + "/React/Fabric/" + @third_party_provider_implementation ,
50+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_header ,
51+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_implementation ,
5252 ] )
5353
5454 # Act
@@ -58,8 +58,8 @@ def testCheckAndGenerateEmptyThirdPartyProvider_whenFileAlreadyExists_doNothing(
5858 assert_equal ( Pathname . pwd_invocation_count , 1 )
5959 assert_equal ( Pod ::Config . instance . installation_root . relative_path_from_invocation_count , 1 )
6060 assert_equal ( FileMock . exist_invocation_params , [
61- @prefix + "/React/Fabric/" + @third_party_provider_header ,
62- @prefix + "/React/Fabric/" + @third_party_provider_implementation ,
61+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_header ,
62+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_implementation ,
6363 ] )
6464 assert_equal ( DirMock . exist_invocation_params , [ ] )
6565 assert_equal ( Pod ::UI . collected_messages , [ ] )
@@ -84,7 +84,7 @@ def testCheckAndGenerateEmptyThirdPartyProvider_whenHeaderMissingAndCodegenMissi
8484 assert_equal ( Pathname . pwd_invocation_count , 1 )
8585 assert_equal ( Pod ::Config . instance . installation_root . relative_path_from_invocation_count , 1 )
8686 assert_equal ( FileMock . exist_invocation_params , [
87- @prefix + "/React/Fabric/" + @third_party_provider_header
87+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_header
8888 ] )
8989 assert_equal ( DirMock . exist_invocation_params , [
9090 @base_path + "/" + @prefix + "/../react-native-codegen" ,
@@ -100,8 +100,8 @@ def testCheckAndGenerateEmptyThirdPartyProvider_whenImplementationMissingAndCode
100100
101101 # Arrange
102102 FileMock . mocked_existing_files ( [
103- @prefix + "/React/Fabric/" + @third_party_provider_header ,
104- @prefix + "/React/Fabric/tmpSchemaList.txt"
103+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_header ,
104+ @base_path + "/" + @ prefix + "/React/Fabric/tmpSchemaList.txt"
105105 ] )
106106
107107 DirMock . mocked_existing_dirs ( [
@@ -116,9 +116,9 @@ def testCheckAndGenerateEmptyThirdPartyProvider_whenImplementationMissingAndCode
116116 assert_equal ( Pathname . pwd_invocation_count , 1 )
117117 assert_equal ( Pod ::Config . instance . installation_root . relative_path_from_invocation_count , 1 )
118118 assert_equal ( FileMock . exist_invocation_params , [
119- @prefix + "/React/Fabric/" + @third_party_provider_header ,
120- @prefix + "/React/Fabric/" + @third_party_provider_implementation ,
121- @prefix + "/React/Fabric/tmpSchemaList.txt" ,
119+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_header ,
120+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_implementation ,
121+ @base_path + "/" + @ prefix + "/React/Fabric/tmpSchemaList.txt" ,
122122 ] )
123123 assert_equal ( DirMock . exist_invocation_params , [
124124 @base_path + "/" + @prefix + "/../react-native-codegen" ,
@@ -127,20 +127,20 @@ def testCheckAndGenerateEmptyThirdPartyProvider_whenImplementationMissingAndCode
127127 assert_equal ( Pod ::UI . collected_messages , [ "[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider" ] )
128128 assert_equal ( $collected_commands, [ ] )
129129 assert_equal ( FileMock . open_invocation_count , 1 )
130- assert_equal ( FileMock . open_files_with_mode [ @prefix + "/React/Fabric/tmpSchemaList.txt" ] , 'w' )
130+ assert_equal ( FileMock . open_files_with_mode [ @prefix + "/React/Fabric/tmpSchemaList.txt" ] , nil )
131131 assert_equal ( FileMock . open_files [ 0 ] . collected_write , [ "[]" ] )
132132 assert_equal ( FileMock . open_files [ 0 ] . fsync_invocation_count , 1 )
133133 assert_equal ( Pod ::Executable . executed_commands [ 0 ] , {
134134 "command" => "node" ,
135135 "arguments" => [
136136 @base_path + "/" + @prefix + "/scripts/generate-provider-cli.js" ,
137137 "--platform" , 'ios' ,
138- "--schemaListPath" , @prefix + "/React/Fabric/tmpSchemaList.txt" ,
139- "--outputDir" , @prefix + "/React/Fabric"
138+ "--schemaListPath" , @base_path + "/" + @ prefix + "/React/Fabric/tmpSchemaList.txt" ,
139+ "--outputDir" , @base_path + "/" + @ prefix + "/React/Fabric"
140140 ]
141141 } )
142142 assert_equal ( FileMock . delete_invocation_count , 1 )
143- assert_equal ( FileMock . deleted_files , [ @prefix + "/React/Fabric/tmpSchemaList.txt" ] )
143+ assert_equal ( FileMock . deleted_files , [ @base_path + "/" + @ prefix + "/React/Fabric/tmpSchemaList.txt" ] )
144144 end
145145
146146 def testCheckAndGenerateEmptyThirdPartyProvider_whenBothMissing_buildCodegen ( )
@@ -156,8 +156,8 @@ def testCheckAndGenerateEmptyThirdPartyProvider_whenBothMissing_buildCodegen()
156156 assert_equal ( Pathname . pwd_invocation_count , 1 )
157157 assert_equal ( Pod ::Config . instance . installation_root . relative_path_from_invocation_count , 1 )
158158 assert_equal ( FileMock . exist_invocation_params , [
159- @prefix + "/React/Fabric/" + @third_party_provider_header ,
160- @prefix + "/React/Fabric/" + @tmp_schema_list_file
159+ @base_path + "/" + @ prefix + "/React/Fabric/" + @third_party_provider_header ,
160+ @base_path + "/" + @ prefix + "/React/Fabric/" + @tmp_schema_list_file
161161 ] )
162162 assert_equal ( DirMock . exist_invocation_params , [
163163 @base_path + "/" + @prefix + "/../react-native-codegen" ,
@@ -176,18 +176,18 @@ def testCheckAndGenerateEmptyThirdPartyProvider_whenBothMissing_buildCodegen()
176176 "arguments" => [
177177 @base_path + "/" + @prefix + "/scripts/generate-provider-cli.js" ,
178178 "--platform" , 'ios' ,
179- "--schemaListPath" , @prefix + "/React/Fabric/" + @tmp_schema_list_file ,
180- "--outputDir" , @prefix + "/React/Fabric"
179+ "--schemaListPath" , @base_path + "/" + @ prefix + "/React/Fabric/" + @tmp_schema_list_file ,
180+ "--outputDir" , @base_path + "/" + @ prefix + "/React/Fabric"
181181 ]
182182 } )
183183 end
184184
185185 def testCheckAndGenerateEmptyThirdPartyProvider_withAbsoluteReactNativePath_buildCodegen ( )
186186 # Arrange
187- rn_path = '/Users/distiller/react-native/ packages/react-native'
187+ rn_path = 'packages/react-native'
188188 codegen_cli_path = rn_path + "/../@react-native/codegen"
189189 DirMock . mocked_existing_dirs ( [
190- codegen_cli_path ,
190+ @base_path + "/" + codegen_cli_path ,
191191 ] )
192192
193193 # Act
@@ -197,28 +197,28 @@ def testCheckAndGenerateEmptyThirdPartyProvider_withAbsoluteReactNativePath_buil
197197 assert_equal ( Pathname . pwd_invocation_count , 1 )
198198 assert_equal ( Pod ::Config . instance . installation_root . relative_path_from_invocation_count , 1 )
199199 assert_equal ( FileMock . exist_invocation_params , [
200- rn_path + "/React/Fabric/" + @third_party_provider_header ,
201- rn_path + "/React/Fabric/" + @tmp_schema_list_file
200+ @base_path + "/" + rn_path + "/React/Fabric/" + @third_party_provider_header ,
201+ @base_path + "/" + rn_path + "/React/Fabric/" + @tmp_schema_list_file
202202 ] )
203203 assert_equal ( DirMock . exist_invocation_params , [
204- rn_path + "/../react-native-codegen" ,
205- codegen_cli_path ,
206- codegen_cli_path + "/lib" ,
204+ @base_path + "/" + rn_path + "/../react-native-codegen" ,
205+ @base_path + "/" + codegen_cli_path ,
206+ @base_path + "/" + codegen_cli_path + "/lib" ,
207207 ] )
208208 assert_equal ( Pod ::UI . collected_messages , [
209- "[Codegen] building #{ codegen_cli_path } ." ,
209+ "[Codegen] building #{ @base_path + "/" + codegen_cli_path } ." ,
210210 "[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider"
211211 ] )
212- assert_equal ( $collected_commands, [ rn_path + "/../@react-native/codegen/scripts/oss/build.sh" ] )
212+ assert_equal ( $collected_commands, [ @base_path + "/" + rn_path + "/../@react-native/codegen/scripts/oss/build.sh" ] )
213213 assert_equal ( FileMock . open_files [ 0 ] . collected_write , [ "[]" ] )
214214 assert_equal ( FileMock . open_files [ 0 ] . fsync_invocation_count , 1 )
215215 assert_equal ( Pod ::Executable . executed_commands [ 0 ] , {
216216 "command" => "node" ,
217217 "arguments" => [
218- rn_path + "/scripts/generate-provider-cli.js" ,
218+ @base_path + "/" + rn_path + "/scripts/generate-provider-cli.js" ,
219219 "--platform" , 'ios' ,
220- "--schemaListPath" , rn_path + "/React/Fabric/" + @tmp_schema_list_file ,
221- "--outputDir" , rn_path + "/React/Fabric"
220+ "--schemaListPath" , @base_path + "/" + rn_path + "/React/Fabric/" + @tmp_schema_list_file ,
221+ "--outputDir" , @base_path + "/" + rn_path + "/React/Fabric"
222222 ]
223223 } )
224224 end
0 commit comments