Commit cae31b0d authored by Francis Chong's avatar Francis Chong

Merge pull request #403 from siuying/validate_platform

raise informative error message when user supplied invalid platform
parents 09ebfb1a 695509fe
...@@ -199,6 +199,8 @@ module Pod ...@@ -199,6 +199,8 @@ module Pod
target = '4.3' target = '4.3'
when :osx when :osx
target = '10.6' target = '10.6'
else
raise Informative, "Unsupported platform: platform must be one of [:ios, :osx]"
end end
end end
@target_definition.platform = Platform.new(name, target) @target_definition.platform = Platform.new(name, target)
......
...@@ -16,6 +16,12 @@ describe "Pod::Podfile" do ...@@ -16,6 +16,12 @@ describe "Pod::Podfile" do
podfile.target_definitions[:default].platform.deployment_target.should == Pod::Version.new('4.3') podfile.target_definitions[:default].platform.deployment_target.should == Pod::Version.new('4.3')
end end
it "raise error if unsupported platform is supplied" do
lambda {
Pod::Podfile.new { platform :iOS }
}.should.raise(StandardError, "Unsupported platform")
end
it "adds dependencies" do it "adds dependencies" do
podfile = Pod::Podfile.new { pod 'ASIHTTPRequest'; pod 'SSZipArchive', '>= 0.1' } podfile = Pod::Podfile.new { pod 'ASIHTTPRequest'; pod 'SSZipArchive', '>= 0.1' }
podfile.dependencies.size.should == 2 podfile.dependencies.size.should == 2
......
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