Skip to content

Commit

Permalink
Merge pull request #384 from dnkoutso/fix_test_specs_parsing
Browse files Browse the repository at this point in the history
Correctly include parent dependencies when parsing testspecs
  • Loading branch information
orta authored Jun 12, 2017
2 parents f554509 + 8011a67 commit dae60a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

##### Bug Fixes

* Correctly include parent dependencies when parsing testspecs
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#384](https://github.com/CocoaPods/Core/pull/384)

* Fix typo in `specification.rb`
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#376](https://github.com/CocoaPods/Core/pull/376)
Expand Down
6 changes: 3 additions & 3 deletions lib/cocoapods-core/podfile/target_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,8 @@ def parse_configuration_whitelist(name, requirements)
requirements.pop if options.empty?
end

# Removes :subspecs from the requirements list, and stores the pods
# with the given subspecs as dependencies.
# Removes :subspecs and :testspecs from the requirements list, and stores the pods
# with the given subspecs or test specs as dependencies.
#
# @param [String] name
#
Expand All @@ -879,7 +879,7 @@ def parse_subspecs(name, requirements)
end if test_specs

requirements.pop if options.empty?
!subspecs.nil? || !test_specs.nil?
!subspecs.nil?
end

#-----------------------------------------------------------------------#
Expand Down
4 changes: 2 additions & 2 deletions spec/podfile/target_definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ module Pod

it 'allows depending on testspecs' do
@parent.store_pod('RestKit', :testspecs => %w(Tests))
@parent.dependencies.map(&:name).sort.should == %w(RestKit/Tests)
@parent.dependencies.map(&:name).sort.should == %w(RestKit RestKit/Tests)
end

it 'allows depending on both subspecs and testspecs' do
@parent.store_pod('RestKit', :subspecs => %w(Networking))
@parent.store_pod('RestKit', :testspecs => %w(Tests))
@parent.dependencies.map(&:name).sort.should == %w(RestKit/Networking RestKit/Tests)
@parent.dependencies.map(&:name).sort.should == %w(RestKit RestKit/Networking RestKit/Tests)
end

it 'allows depending on both subspecs and testspecs in chaining' do
Expand Down

0 comments on commit dae60a3

Please sign in to comment.