Commit 59a198e2 authored by Kyle Fuller's avatar Kyle Fuller Committed by Fabio Pelosin

[ExternalSource] Fix issue with JSON podspecs

Closes #2320
parent cb854fa9
......@@ -101,7 +101,15 @@ module Pod
target.rmtree if target.exist?
downloader = Downloader.for_target(target, params)
downloader.download
store_podspec(sandbox, target + "#{name}.podspec")
podspec_path = target + "#{name}.podspec"
json = false
unless Pathname(podspec_path).exist?
podspec_path = target + "#{name}.podspec.json"
json = true
end
store_podspec(sandbox, target + podspec_path, json)
sandbox.store_pre_downloaded_pod(name)
if downloader.options_specific?
source = params
......
......@@ -47,6 +47,22 @@ module Pod
},
}
end
it "pre-downloads the Pod with a JSON podspec and stores the relevant information in the sandbox" do
dependency = Dependency.new("Reachability", :git => fixture('integration/Reachability'), :branch => 'json_podspec')
source = ExternalSources.from_dependency(dependency, nil)
sandbox = config.sandbox
source.send(:pre_download, sandbox)
path = config.sandbox.root + 'Local Podspecs/Reachability.podspec'
path.should.exist?
sandbox.predownloaded_pods.should == ["Reachability"]
sandbox.checkout_sources.should == {
"Reachability" => {
:git => fixture('integration/Reachability'),
:commit => "4ec575e4b074dcc87c44018cce656672a979b34a"
}
}
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