[Validator] Error when xcodebuild fails

I gave up trying to write a test for this. Either merge without test, someone add a test and merge, or reject this patch.

Here's a base for anyone willing to add tests:

```diff
+      it 'errors when xcodebuild exits with non 0 exit code' do
+        Process::Status.any_instance.stubs(:success?).returns(false)
+
+        validator = Validator.new(podspec_path, SourcesManager.master.map(&:url))
+        validator.stubs(:check_file_patterns)
+        validator.stubs(:validate_url)
+        validator.validate
+
+        validator.results.count.should == 1
+        validator.result_type.should == :error
+      end
+
```
But it won't be printed if you raise before the method returns. 

-Samuel E. Giddins

On Dec 29, 2014, at 10:43 AM, Kyle Fuller <notifications@github.com> wrote:

In lib/cocoapods/validator.rb:

> @@ -517,7 +517,15 @@ def parse_xcodebuild_output(output)
>      #
>      def xcodebuild
>        UI.puts 'xcodebuild clean build -target Pods' if config.verbose?
> -      `xcodebuild clean build -target Pods 2>&1`
> +      output = `xcodebuild clean build -target Pods 2>&1`
> +
> +      unless $?.success?
> +        message = 'Returned a non-successful exit code.'
> +        message += ' You can use `--verbose` for more information.' unless config.verbose?
It's printed elsewhere

output = Dir.chdir(config.sandbox_root) { xcodebuild }
UI.puts output


—
Reply to this email directly or view it on GitHub.