Commit 162d573b authored by Orta Therox's avatar Orta Therox

Expand the usage of the GH Inspector to all of pod install

parent 77d6a4a5
...@@ -12,6 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,6 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Dimitris Koutsogiorgas](https://github.com/dnkoutso) [Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#5837](https://github.com/CocoaPods/CocoaPods/pull/5837) [#5837](https://github.com/CocoaPods/CocoaPods/pull/5837)
* GitHub issue inspection will now happen for any StandardError in a pod install
[Orta Therox](https://github.com/orta)
[#5950](https://github.com/CocoaPods/CocoaPods/pull/5950)
##### Bug Fixes ##### Bug Fixes
......
...@@ -45,7 +45,7 @@ Gem::Specification.new do |s| ...@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'colored', '~> 1.2' s.add_runtime_dependency 'colored', '~> 1.2'
s.add_runtime_dependency 'escape', '~> 0.0.4' s.add_runtime_dependency 'escape', '~> 0.0.4'
s.add_runtime_dependency 'fourflusher', '~> 1.0.1' s.add_runtime_dependency 'fourflusher', '~> 1.0.1'
s.add_runtime_dependency 'gh_inspector', '~> 1.0' s.add_runtime_dependency 'gh_inspector', '~> 1.0'
s.add_runtime_dependency 'nap', '~> 1.0' s.add_runtime_dependency 'nap', '~> 1.0'
s.add_development_dependency 'bacon', '~> 1.1' s.add_development_dependency 'bacon', '~> 1.1'
......
require 'gh_inspector'
module Pod module Pod
class Command class Command
class Install < Command class Install < Command
...@@ -35,6 +37,15 @@ module Pod ...@@ -35,6 +37,15 @@ module Pod
installer.repo_update = repo_update?(:default => false) installer.repo_update = repo_update?(:default => false)
installer.update = false installer.update = false
installer.install! installer.install!
rescue StandardError => e
search_for_exceptions(e)
raise e
end
def search_for_exceptions(exception)
inspector = GhInspector::Inspector.new 'cocoapods', 'cocoapods'
message_delegate = UserInterface::InspectorReporter.new
inspector.search_exception exception, message_delegate
end end
end end
end end
......
...@@ -27,5 +27,35 @@ module Pod ...@@ -27,5 +27,35 @@ module Pod
run_command('install', '--repo-update') run_command('install', '--repo-update')
end end
end end
describe 'Issue Inspection' do
before do
file = temporary_directory + 'Podfile'
File.open(file, 'w') do |f|
f.puts('platform :ios')
f.puts('pod "Reachability"')
end
end
it 'passes raised StandardError to the GH Inspector' do
error = StandardError
# Replace first method call with raising an error
Pod::Command.any_instance.expects(:installer_for_config).raises(error, 'message')
# Ensure that gh inspector is called
Command::Install.any_instance.expects(:search_for_exceptions).returns('')
lambda { run_command('install') }.should.raise error
end
it 'does not pass CP Informative errors to the GH Inspector' do
error = Pod::Informative
Pod::Command.any_instance.expects(:installer_for_config).raises(error, 'message')
# Ensure that gh inspector is not called
Command::Install.any_instance.expects(:search_for_exceptions).never
lambda { run_command('install') }.should.raise error
end
end
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