Commit f1765c07 authored by Samuel Giddins's avatar Samuel Giddins

[HooksManager] Add spec for passing along user options with indifferent access

parent bc390994
...@@ -79,6 +79,19 @@ module Pod ...@@ -79,6 +79,19 @@ module Pod
end end
end end
it 'passes along user-specified options as hashes with indifferent access' do
run_count = 0
@hooks_manager.register('plugin', :post_install) do |_options, user_options|
user_options['key'].should == 'value'
user_options[:key].should == 'value'
run_count += 1
end
@hooks_manager.run(:post_install, Object.new, 'plugin' => { 'key' => 'value' })
@hooks_manager.run(:post_install, Object.new, 'plugin' => { :key => 'value' })
run_count.should == 2
end
it 'raises if no name is given' do it 'raises if no name is given' do
should.raise ArgumentError do should.raise ArgumentError do
@hooks_manager.run(nil, Object.new) {} @hooks_manager.run(nil, Object.new) {}
......
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