Commit 266ba22c authored by Fabio Pelosin's avatar Fabio Pelosin

[AbstracExternalSource] Add spec for JSON podspecs

parent 59a198e2
...@@ -35,12 +35,11 @@ module Pod ...@@ -35,12 +35,11 @@ module Pod
describe 'Subclasses helpers' do describe 'Subclasses helpers' do
it 'pre-downloads the Pod and stores the relevant information in the sandbox' do it 'pre-downloads the Pod and stores the relevant information in the sandbox' do
sandbox = config.sandbox @subject.send(:pre_download, config.sandbox)
@subject.send(:pre_download, sandbox)
path = config.sandbox.root + 'Local Podspecs/Reachability.podspec' path = config.sandbox.root + 'Local Podspecs/Reachability.podspec'
path.should.exist? path.should.exist?
sandbox.predownloaded_pods.should == ['Reachability'] config.sandbox.predownloaded_pods.should == ['Reachability']
sandbox.checkout_sources.should == { config.sandbox.checkout_sources.should == {
'Reachability' => { 'Reachability' => {
:git => fixture('integration/Reachability'), :git => fixture('integration/Reachability'),
:commit => '4ec575e4b074dcc87c44018cce656672a979b34a', :commit => '4ec575e4b074dcc87c44018cce656672a979b34a',
...@@ -48,20 +47,15 @@ module Pod ...@@ -48,20 +47,15 @@ module Pod
} }
end end
it "pre-downloads the Pod with a JSON podspec and stores the relevant information in the sandbox" do it "checks for JSON podspecs" do
dependency = Dependency.new("Reachability", :git => fixture('integration/Reachability'), :branch => 'json_podspec') path = config.sandbox.root + 'Reachability'
source = ExternalSources.from_dependency(dependency, nil) podspec_path = path + 'Reachability.podspec.json'
sandbox = config.sandbox Dir.mkdir(path)
source.send(:pre_download, sandbox) File.open(podspec_path, "w") {}
path = config.sandbox.root + 'Local Podspecs/Reachability.podspec' Pathname.any_instance.stubs(:rmtree)
path.should.exist? Downloader::Git.any_instance.stubs(:download)
sandbox.predownloaded_pods.should == ["Reachability"] config.sandbox.expects(:store_podspec).with('Reachability', podspec_path, true, true)
sandbox.checkout_sources.should == { @subject.send(:pre_download, config.sandbox)
"Reachability" => {
:git => fixture('integration/Reachability'),
:commit => "4ec575e4b074dcc87c44018cce656672a979b34a"
}
}
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