Commit d4af7dfe authored by Eloy Durán's avatar Eloy Durán

[push] Do not push to trunk during tests.

parent 20e6c430
......@@ -61,16 +61,19 @@ module Pod
# @return [void] Silently test the CocoaPods trunk service.
#
def test_trunk
return if skip_test_trunk
return unless @repo == "master"
require 'rest'
base_url = 'https://trunk.cocoapods.org/api/v1'
podspec_files.each do |spec_file|
spec = Pod::Specification.from_file(spec_file)
REST.post("#{base_url}/pods", spec.to_json, 'Content-Type' => 'application/json; charset=utf-8', 'Authorization' => "Token 46dbd9b53eedd840355750621e6385dd")
REST.post("#{base_url}/pods", spec.to_json, 'Content-Type' => 'application/json; charset=utf-8',
'Authorization' => "Token 46dbd9b53eedd840355750621e6385dd")
end
rescue Exception
# Nothing
end
attr_accessor :skip_test_trunk
# Performs a full lint against the podspecs.
#
......
......@@ -5,6 +5,11 @@ module Pod
extend SpecHelper::Command
extend SpecHelper::TemporaryRepos
# Don't test push the spec to the trunk app
def command(*a)
super.tap { |cmd| cmd.send(:skip_test_trunk=, true) }
end
before do
config.repos_dir = SpecHelper.tmp_repos_path
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