Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[Linter] Use the deployment target of the specification.

Closes #304.
  • Loading branch information...
commit de9fe2dcea88a6711ed69bfd38a6651c022af544 1 parent 8d1430a
@fabiopelosin fabiopelosin authored
Showing with 17 additions and 5 deletions.
  1. +6 −5 lib/cocoapods/command/spec.rb
  2. +11 −0 spec/unit/command/spec_spec.rb
View
11 lib/cocoapods/command/spec.rb
@@ -241,13 +241,14 @@ def install_pod
end
def podfile_from_spec
- name = spec.name
- podspec = file.realpath.to_s
- platform_sym = @platform.to_sym
- podfile = Pod::Podfile.new do
- platform(platform_sym)
+ name = spec.name
+ podspec = file.realpath.to_s
+ platform = @platform
+ podfile = Pod::Podfile.new do
+ platform(platform)
dependency name, :podspec => podspec
end
+ podfile
end
def set_up_lint_environment
View
11 spec/unit/command/spec_spec.rb
@@ -106,4 +106,15 @@ def stub_podspec(pattern = nil, replacement = nil)
linter.lint.should == false
linter.errors.join(' | ').should.include "The resources did not match any file"
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
Please sign in to comment.
Something went wrong with that request. Please try again.