diff --git a/CHANGELOG.md b/CHANGELOG.md index f68a5c278..fe8e760c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ##### Enhancements +* Fix requirements cloning for `:testspecs` + [Justin Martin](https://github.com/justinseanmartin) + [#401](https://github.com/CocoaPods/Core/pull/401) + * Add Podfile DSL for `script_phase` [Dimitris Koutsogiorgas](https://github.com/dnkoutso) [#389](https://github.com/CocoaPods/Core/pull/389) diff --git a/lib/cocoapods-core/podfile/target_definition.rb b/lib/cocoapods-core/podfile/target_definition.rb index 942e235a2..f553b47d1 100644 --- a/lib/cocoapods-core/podfile/target_definition.rb +++ b/lib/cocoapods-core/podfile/target_definition.rb @@ -921,7 +921,8 @@ def parse_subspecs(name, requirements) end if subspecs test_specs.each do |ss| - store_pod("#{name}/#{ss}", *requirements.dup) + requirements_copy = requirements.map(&:dup) + store_pod("#{name}/#{ss}", *requirements_copy) end if test_specs requirements.pop if options.empty? diff --git a/spec/podfile/target_definition_spec.rb b/spec/podfile/target_definition_spec.rb index 0020bb4c4..6f7a2a5bf 100644 --- a/spec/podfile/target_definition_spec.rb +++ b/spec/podfile/target_definition_spec.rb @@ -409,6 +409,15 @@ module Pod @child.all_whitelisted_configurations.sort.should == %w(Debug Release) end + it 'whitelistes pod configurations with testspecs' do + @parent.build_configurations = { 'Debug' => :debug, 'Release' => :release } + @parent.store_pod('RestKit', :testspecs => %w(Tests), :configuration => 'Debug') + @parent.should.pod_whitelisted_for_configuration?('RestKit', 'Debug') + @parent.should.pod_whitelisted_for_configuration?('RestKit/Tests', 'Debug') + @parent.should.not.pod_whitelisted_for_configuration?('RestKit', 'Release') + @parent.should.not.pod_whitelisted_for_configuration?('RestKit/Tests', 'Release') + end + #--------------------------------------# it 'returns its platform' do