Commit 7c334329 authored by Ian Ynda-Hummel's avatar Ian Ynda-Hummel

Add an integration test for basic Podfile construction.

parent 376f2412
......@@ -38,26 +38,28 @@ module Pod
def podfile_template(project)
platforms = project.targets.map { |t| t.platform_name }.uniq
if platforms.length == 1
has_global_platform = platforms.length == 1
if has_global_platform
podfile = <<-PLATFORM
platform #{platforms.first}
platform :#{platforms.first}
PLATFORM
else
podfile = <<-PLATFORM
# Uncomment this line to define the platform for your project
platform :ios, "6.0"
# Uncomment this line to define a global platform for your project
# platform :ios, "6.0"
PLATFORM
end
for target in project.targets
podfile << target_module(target)
podfile << target_module(target, !has_global_platform)
end
podfile
end
def target_module(target, define_platform = true)
platform = "platform #{target.platform_name}" if define_platform
platform = "platform :#{target.platform_name}" if define_platform
return <<-TARGET
target :#{target.name} do
target "#{target.name}" do
#{platform}
end
TARGET
......
......@@ -378,6 +378,20 @@ describe "Integration" do
#--------------------------------------#
describe "Pod init" do
describe "Initializes a Podfile with a single platform" do
check "init", "init_single_platform"
end
describe "Initializes a Podfile with no uniform platform" do
check "init", "init_multiple_platforms"
end
end
#--------------------------------------#
end
......
# Uncomment this line to define a global platform for your project
# platform :ios, "6.0"
target "SampleApp" do
platform :osx
end
target "SampleiOSApp" do
platform :ios
end
platform :osx
target "SampleApp" do
end
target "SampleApp copy" do
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment