Skip to content

Commit

Permalink
Fix requirements cloning for :testspecs
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Martin committed Aug 29, 2017
1 parent bdec7d4 commit d9502fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion lib/cocoapods-core/podfile/target_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
9 changes: 9 additions & 0 deletions spec/podfile/target_definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9502fa

Please sign in to comment.