Skip to content

Commit 1a1fcee

Browse files
committed
[Podfile] Allow inhibit_all_warnings! in parent and child scopes
Closes #472
1 parent b7146a5 commit 1a1fcee

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111

1212
##### Bug Fixes
1313

14-
* None.
15-
14+
* Fix a crash when using `inhibit_all_warnings!` in parent and child scopes
15+
[Eric Amorde](https://github.com/amorde)
16+
[#472](https://github.com/CocoaPods/Core/issues/472)
1617

1718
## 1.6.0.beta.2 (2018-10-17)
1819

lib/cocoapods-core/podfile/target_definition.rb

+1
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ def inhibit_warnings_hash
893893
if inhibit_hash['all']
894894
# Clean pods that are set to not inhibit inside parent if inhibit_all_warnings! was set.
895895
parent_hash['not_for_pods'] = nil
896+
inhibit_hash.delete('all') if parent_hash['all']
896897
end
897898
parent_hash.merge(inhibit_hash) do |_, l, r|
898899
Array(l).concat(r).uniq

spec/podfile/dsl_spec.rb

+19
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,25 @@ module Pod
205205
target = podfile.target_definitions['InheritedLevelTwo']
206206
target.inhibits_warnings_for_pod?('PonyDebugger').should.be.true
207207
end
208+
209+
it 'allows inhibiting all warnings in parent and child scopes' do
210+
podfile = Podfile.new do
211+
inhibit_all_warnings!
212+
target 'App' do
213+
pod 'PonyDebugger'
214+
inhibit_all_warnings!
215+
target 'Inherited' do
216+
inhibit_all_warnings!
217+
end
218+
end
219+
end
220+
221+
target = podfile.target_definitions['App']
222+
target.inhibits_warnings_for_pod?('PonyDebugger').should.be.true
223+
224+
target = podfile.target_definitions['Inherited']
225+
target.inhibits_warnings_for_pod?('PonyDebugger').should.be.true
226+
end
208227
end
209228

210229
describe 'modular headers' do

0 commit comments

Comments
 (0)