From 8011a67e379296ba2a3ff437de31dfa7bbcb3a3b Mon Sep 17 00:00:00 2001 From: Dimitris Koutsogiorgas Date: Sat, 10 Jun 2017 10:55:51 -0700 Subject: [PATCH] Correctly include parent dependencies when parsing testspecs --- CHANGELOG.md | 4 ++++ lib/cocoapods-core/podfile/target_definition.rb | 6 +++--- spec/podfile/target_definition_spec.rb | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d68faca52..45727769a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/lib/cocoapods-core/podfile/target_definition.rb b/lib/cocoapods-core/podfile/target_definition.rb index 663b0bd38..a74f34e97 100644 --- a/lib/cocoapods-core/podfile/target_definition.rb +++ b/lib/cocoapods-core/podfile/target_definition.rb @@ -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 # @@ -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 #-----------------------------------------------------------------------# diff --git a/spec/podfile/target_definition_spec.rb b/spec/podfile/target_definition_spec.rb index 64b307d88..942a98d4d 100644 --- a/spec/podfile/target_definition_spec.rb +++ b/spec/podfile/target_definition_spec.rb @@ -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