Skip to content

Commit 2db98d0

Browse files
fix: add missing test for merging Podfiles
Add missing test for #3935
1 parent d95caad commit 2db98d0

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

test/cocoapods-service.ts

+44
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,50 @@ end
306306
post_install do |installer|
307307
post_installplugin1_0 installer
308308
end
309+
end`,
310+
},
311+
{
312+
testCaseDescription: "adds plugin with postinstall when project's Podfile has content, but does not have postinstall",
313+
input: `
314+
target 'MyApp' do
315+
pod 'GoogleAnalytics', '~> 3.1'
316+
end
317+
318+
post_install do |installer|
319+
installer.pods_project.targets.each do |target|
320+
puts target.name
321+
end
322+
end`,
323+
output: `use_frameworks!
324+
325+
target "projectName" do
326+
# Begin Podfile - pluginPlatformsFolderPath/Podfile
327+
328+
target 'MyApp' do
329+
pod 'GoogleAnalytics', '~> 3.1'
330+
end
331+
332+
def post_installplugin1_0 (installer)
333+
installer.pods_project.targets.each do |target|
334+
puts target.name
335+
end
336+
end
337+
# End Podfile
338+
339+
# Begin Podfile - secondPluginPlatformsFolderPath/Podfile
340+
pod 'OCMock', '~> 2.0.1'
341+
# End Podfile
342+
343+
post_install do |installer|
344+
post_installplugin1_0 installer
345+
end
346+
end`,
347+
projectPodfileContent: `use_frameworks!
348+
349+
target "projectName" do
350+
# Begin Podfile - secondPluginPlatformsFolderPath/Podfile
351+
pod 'OCMock', '~> 2.0.1'
352+
# End Podfile
309353
end`,
310354
},
311355
{

0 commit comments

Comments
 (0)