Skip to content

Commit

Permalink
Merge 568b87f into 2fa29fb
Browse files Browse the repository at this point in the history
  • Loading branch information
HBehrens committed Jun 21, 2013
2 parents 2fa29fb + 568b87f commit 20775df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/cocoapods/validator.rb
Expand Up @@ -208,8 +208,11 @@ def install_pod
installer = Installer.new(sandbox, podfile)
installer.install!

file_accessors = installer.aggregate_targets.first.pod_targets.first.file_accessors
@file_accessor = file_accessors.find { |accessor| accessor.spec == spec }
file_accessors = installer.aggregate_targets.map do |target|
target.pod_targets.map(&:file_accessors)
end.flatten

@file_accessor = file_accessors.find { |accessor| accessor.spec.root.name == spec.root.name }
config.silent
end

Expand Down
12 changes: 12 additions & 0 deletions spec/unit/validator_spec.rb
Expand Up @@ -64,6 +64,18 @@ def podspec_path
validator.results.map(&:to_s).first.should.match /source_files.*did not match/
validator.result_type.should == :error
end

it "validates a podspec with dependencies" do
podspec = stub_podspec(/s.name.*$/, 's.name = "ZKit"')
podspec.gsub! /s.requires_arc/, "s.dependency 'SBJson', '~> 3.2'\n s.requires_arc"
file = write_podspec(podspec, "ZKit.podspec")

spec = Specification.from_file(file)
validator = Validator.new(spec)
validator.validate
validator.results.map(&:to_s).first.should.match /should match the name/
validator.validated?.should.be.false
end

#--------------------------------------#

Expand Down

0 comments on commit 20775df

Please sign in to comment.