Commit 64a1b0c7 authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Call the specification hooks per each target definition

Closes #985
parent 6289a796
......@@ -389,7 +389,7 @@ module Pod
executed = false
libraries_using_spec(spec).each do |lib|
lib_representation = library_rep(lib)
executed ||= run_spec_pre_install_hook(spec, lib_representation)
executed |= run_spec_pre_install_hook(spec, lib_representation)
end
UI.message "- #{spec.name}" if executed
end
......@@ -448,7 +448,7 @@ module Pod
executed = false
libraries_using_spec(spec).each do |lib|
lib_representation = library_rep(lib)
executed ||= run_spec_post_install_hook(spec, lib_representation)
executed |= run_spec_post_install_hook(spec, lib_representation)
end
UI.message "- #{spec.name}" if executed
end
......
......@@ -372,6 +372,27 @@ module Pod
@installer.send(:run_pre_install_hooks)
end
it "calls the hooks in the specs for each target" do
library_ios = Library.new(nil)
library_osx = Library.new(nil)
library_ios.platform = Platform.new(:ios, '6.0')
library_osx.platform = Platform.new(:osx, '10.8')
library_ios.specs = [@spec]
library_osx.specs = [@spec]
library_ios.stubs(:name).returns('label')
library_osx.stubs(:name).returns('label')
@installer.stubs(:libraries).returns([library_ios, library_osx])
@installer.stubs(:installer_rep).returns(stub())
@installer.stubs(:library_rep).returns(stub())
@spec.expects(:pre_install!).twice
@spec.expects(:post_install!).twice
@installer.send(:run_pre_install_hooks)
@installer.send(:run_post_install_hooks)
end
it "run_post_install_hooks" do
installer_rep = stub()
target_installer_data = stub()
......
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