Commit 31807c80 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[HooksManager] Show the file that a hook without a name comes from

Closes https://github.com/CocoaPods/CocoaPods/issues/2990.
parent f337b27f
...@@ -45,7 +45,7 @@ module Pod ...@@ -45,7 +45,7 @@ module Pod
raise ArgumentError, 'Missing block' unless block raise ArgumentError, 'Missing block' unless block
UI.warn '[Hooks] The use of hooks without specifying a `plugin_name` ' \ UI.warn '[Hooks] The use of hooks without specifying a `plugin_name` ' \
'has been deprecated.' unless plugin_name "has been deprecated (from file `#{block.binding.eval('File.expand_path __FILE__')}`)." unless plugin_name
@name = name @name = name
@plugin_name = plugin_name @plugin_name = plugin_name
......
...@@ -32,6 +32,7 @@ module Pod ...@@ -32,6 +32,7 @@ module Pod
it 'warns if no plugin name is given' do it 'warns if no plugin name is given' do
@hooks_manager.register(:post_install) {} @hooks_manager.register(:post_install) {}
UI.warnings.should.match /hooks without.*deprecated/ UI.warnings.should.match /hooks without.*deprecated/
UI.warnings.should.match /#{__FILE__}/
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment