Commit de9fe2dc authored by Fabio Pelosin's avatar Fabio Pelosin

[Linter] Use the deployment target of the specification.

Closes #304.
parent 8d1430a8
...@@ -241,13 +241,14 @@ module Pod ...@@ -241,13 +241,14 @@ module Pod
end end
def podfile_from_spec def podfile_from_spec
name = spec.name name = spec.name
podspec = file.realpath.to_s podspec = file.realpath.to_s
platform_sym = @platform.to_sym platform = @platform
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
platform(platform_sym) platform(platform)
dependency name, :podspec => podspec dependency name, :podspec => podspec
end end
podfile
end end
def set_up_lint_environment def set_up_lint_environment
......
...@@ -106,4 +106,15 @@ describe "Pod::Command::Spec::Linter" do ...@@ -106,4 +106,15 @@ describe "Pod::Command::Spec::Linter" do
linter.lint.should == false linter.lint.should == false
linter.errors.join(' | ').should.include "The resources did not match any file" linter.errors.join(' | ').should.include "The resources did not match any file"
end end
it "Uses the deployment target of the specification" do
spec, file = write_podspec(stub_podspec)
spec.stubs(:available_platforms).returns([Pod::Platform.new(:ios, "5.0")])
linter = Pod::Command::Spec::Linter.new(spec)
linter.quick = true
linter.lint
podfile = linter.podfile_from_spec
deployment_target = podfile.target_definitions[:default].platform.deployment_target
deployment_target.to_s.should == "5.0"
end
end 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