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 ...@@ -38,26 +38,28 @@ module Pod
def podfile_template(project) def podfile_template(project)
platforms = project.targets.map { |t| t.platform_name }.uniq 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 podfile = <<-PLATFORM
platform #{platforms.first} platform :#{platforms.first}
PLATFORM PLATFORM
else else
podfile = <<-PLATFORM podfile = <<-PLATFORM
# Uncomment this line to define the platform for your project # Uncomment this line to define a global platform for your project
platform :ios, "6.0" # platform :ios, "6.0"
PLATFORM PLATFORM
end end
for target in project.targets for target in project.targets
podfile << target_module(target) podfile << target_module(target, !has_global_platform)
end end
podfile podfile
end end
def target_module(target, define_platform = true) 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 return <<-TARGET
target :#{target.name} do
target "#{target.name}" do
#{platform} #{platform}
end end
TARGET TARGET
......
...@@ -378,6 +378,20 @@ describe "Integration" do ...@@ -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 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