Skip to content

Commit 6c74352

Browse files
philIipfacebook-github-bot
authored andcommitted
convert ProjectMock path type from string to Pathname
Differential Revision: D47041355 fbshipit-source-id: 81d777ed6fd4fbc1a314313dfc5d2bcc8b42bfa1
1 parent 6fbbe26 commit 6c74352

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

packages/react-native/scripts/cocoapods/__tests__/test_utils/InstallerMock.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class UserProjectMock
119119

120120

121121
def initialize(path = "/test/path.xcproj", build_configurations = [], native_targets: [])
122-
@path = path
122+
@path = Pathname.new(path)
123123
@build_configurations = build_configurations
124124
@native_targets = native_targets
125125
@save_invocation_count = 0

packages/react-native/scripts/cocoapods/__tests__/test_utils/PathnameMock.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def self.pwd_invocation_count
3434
return @@pwd_invocation_count
3535
end
3636

37+
def to_s
38+
return @path
39+
end
3740

3841
def self.reset()
3942
@@pwd = ""

packages/react-native/scripts/cocoapods/__tests__/utils-test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def test_fixLibrarySearchPaths_correctlySetsTheSearchPathsForAllProjects
324324
first_target = prepare_target("FirstTarget")
325325
second_target = prepare_target("SecondTarget")
326326
third_target = prepare_target("ThirdTarget")
327-
user_project_mock = UserProjectMock.new("a/path", [
327+
user_project_mock = UserProjectMock.new("/a/path", [
328328
prepare_config("Debug"),
329329
prepare_config("Release"),
330330
],
@@ -434,7 +434,7 @@ def test_applyMacCatalystPatches_correctlyAppliesNecessaryPatches
434434
first_target = prepare_target("FirstTarget")
435435
second_target = prepare_target("SecondTarget")
436436
third_target = prepare_target("ThirdTarget", "com.apple.product-type.bundle")
437-
user_project_mock = UserProjectMock.new("a/path", [
437+
user_project_mock = UserProjectMock.new("/a/path", [
438438
prepare_config("Debug"),
439439
prepare_config("Release"),
440440
],
@@ -492,7 +492,7 @@ def test_applyXcode15Patch_correctlyAppliesNecessaryPatch
492492
}),
493493
], nil)
494494

495-
user_project_mock = UserProjectMock.new("a/path", [
495+
user_project_mock = UserProjectMock.new("/a/path", [
496496
prepare_config("Debug"),
497497
prepare_config("Release"),
498498
],
@@ -644,7 +644,7 @@ def test_updateSearchPaths_whenUseFrameworks_addsSearchPaths
644644
DependencyMock.new("React-ImageManager"),
645645
])
646646
third_target = prepare_target("ThirdTarget", "com.apple.product-type.bundle")
647-
user_project_mock = UserProjectMock.new("a/path", [
647+
user_project_mock = UserProjectMock.new("/a/path", [
648648
prepare_config("Debug"),
649649
prepare_config("Release"),
650650
],
@@ -688,7 +688,7 @@ def test_updateSearchPaths_whenNotUseFrameworks_addsSearchPaths
688688
first_target = prepare_target("FirstTarget")
689689
second_target = prepare_target("SecondTarget")
690690
third_target = prepare_target("ThirdTarget", "com.apple.product-type.bundle")
691-
user_project_mock = UserProjectMock.new("a/path", [
691+
user_project_mock = UserProjectMock.new("/a/path", [
692692
prepare_config("Debug"),
693693
prepare_config("Release"),
694694
],
@@ -750,7 +750,7 @@ def test_applyFlagsForFabric_whenFabricDisabled_doNothing
750750
first_target = prepare_target("FirstTarget")
751751
second_target = prepare_target("SecondTarget")
752752
third_target = prepare_target("ThirdTarget", "com.apple.product-type.bundle")
753-
user_project_mock = UserProjectMock.new("a/path", [
753+
user_project_mock = UserProjectMock.new("/a/path", [
754754
prepare_config("Debug"),
755755
prepare_config("Release"),
756756
],
@@ -779,7 +779,7 @@ def test_applyFlagsForFabric_whenFabricDisabled_doNothing
779779
# ===== #
780780

781781
def prepare_empty_user_project_mock
782-
return UserProjectMock.new("a/path", [
782+
return UserProjectMock.new("/a/path", [
783783
BuildConfigurationMock.new("Debug"),
784784
BuildConfigurationMock.new("Release"),
785785
])

0 commit comments

Comments
 (0)