@@ -1632,6 +1632,58 @@ def test_generate_pods_project_hook_is_idempotent_across_repeated_podspec_requir
16321632 assert_equal [ instance ] , restore_calls
16331633 end
16341634
1635+ def test_hook_warns_once_when_generate_pods_project_is_unavailable_for_expo
1636+ load_firebase_spm
1637+ stub_expo_precompiled_modules ( enabled : true , linkage : :dynamic )
1638+ klass = new_fake_cocoapods_installer_class
1639+ klass . send ( :remove_method , :generate_pods_project )
1640+
1641+ rnfirebase_hook_cocoapods_post_install! ( klass )
1642+ rnfirebase_hook_cocoapods_post_install! ( klass )
1643+ instance = klass . new
1644+
1645+ result = instance . send ( :run_podfile_post_install_hooks )
1646+
1647+ assert_equal :original_result , result
1648+ assert_equal 1 , instance . original_hook_calls
1649+ warnings = Pod ::UI . warnings . select { |warning | warning . include? ( 'generate_pods_project' ) }
1650+ assert_equal 1 , warnings . length
1651+ assert_includes warnings [ 0 ] , 'Expo prebuilt RNFB dynamic-linkage restoration was not hooked'
1652+ end
1653+
1654+ def test_hook_does_not_warn_when_generate_pods_project_is_unavailable_and_expo_prebuilt_is_disabled
1655+ load_firebase_spm
1656+ stub_expo_precompiled_modules ( enabled : false , linkage : :dynamic )
1657+ klass = new_fake_cocoapods_installer_class
1658+ klass . send ( :remove_method , :generate_pods_project )
1659+
1660+ rnfirebase_hook_cocoapods_post_install! ( klass )
1661+
1662+ refute ( Pod ::UI . warnings . any? { |warning | warning . include? ( 'generate_pods_project' ) } )
1663+ end
1664+
1665+ def test_hook_does_not_warn_when_generate_pods_project_is_unavailable_outside_expo
1666+ load_firebase_spm
1667+ klass = new_fake_cocoapods_installer_class
1668+ klass . send ( :remove_method , :generate_pods_project )
1669+
1670+ rnfirebase_hook_cocoapods_post_install! ( klass )
1671+
1672+ refute ( Pod ::UI . warnings . any? { |warning | warning . include? ( 'generate_pods_project' ) } )
1673+ end
1674+
1675+ def test_hook_does_not_warn_when_expo_precompiled_enabled_api_is_unavailable
1676+ load_firebase_spm
1677+ ensure_expo_module!
1678+ Expo . const_set ( :PrecompiledModules , Module . new )
1679+ klass = new_fake_cocoapods_installer_class
1680+ klass . send ( :remove_method , :generate_pods_project )
1681+
1682+ rnfirebase_hook_cocoapods_post_install! ( klass )
1683+
1684+ refute ( Pod ::UI . warnings . any? { |warning | warning . include? ( 'generate_pods_project' ) } )
1685+ end
1686+
16351687 # The generate_pods_project wrapper must not call the original generate method
16361688 # after a restore failure: it must warn with a directed message identifying
16371689 # Expo prebuilt dynamic-linkage restoration and re-raise the original error.
0 commit comments