fix: Podfile 位于工程子目录时在该目录执行 pod install

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-11-03 09:47:59 +09:00
co-authored by Claude Opus 5.5
parent 9c0b677d38
commit a4cd855b0c
2 changed files with 34 additions and 5 deletions
+12
View File
@@ -283,6 +283,18 @@ async def test_run_pod_install_patches_afnetworking(tmp_path, log_streamer):
assert "netinet6/in6.h" not in source_file.read_text()
async def test_run_pod_install_uses_xcode_subdirectory(tmp_path, log_streamer):
"""工程在仓库子目录时,在 Podfile 所在的子目录执行 pod install。"""
sub = tmp_path / "Demo"
sub.mkdir()
(sub / "Podfile").write_text("pod 'SnapKit'")
with patch("asyncio.create_subprocess_exec", return_value=_make_mock_process()) as mock_exec:
await run_pod_install("t1", tmp_path, {"workspace": "Demo/App.xcworkspace", "project": ""})
assert mock_exec.call_args.kwargs["cwd"] == str(sub)
async def test_build_project_passes_scheme_as_exec_argument(tmp_path, log_streamer):
"""Scheme 中的 shell 特殊字符只能作为 xcodebuild 参数,不能被执行。"""
build_dir = tmp_path / "build"