Skip to content

Commit

Permalink
[Linter] Use the deployment target of the specification.
Browse files Browse the repository at this point in the history
Closes #304.
  • Loading branch information
fabiopelosin committed Jun 7, 2012
1 parent 0a41b3a commit 0b56c90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/cocoapods/command/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions spec/unit/command/spec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0b56c90

Please sign in to comment.