Commit 3c7015a6 authored by Hugo Tunius's avatar Hugo Tunius Committed by Kyle Fuller

[PodspecSource Spec] Add spec for failing load of external HTTP podspec

parent 86211405
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../../../spec_helper', __FILE__)
require 'webmock'
module Pod module Pod
describe ExternalSources::PodspecSource do describe ExternalSources::PodspecSource do
...@@ -52,5 +53,17 @@ module Pod ...@@ -52,5 +53,17 @@ module Pod
path.should == 'http://www.example.com/Reachability.podspec' path.should == 'http://www.example.com/Reachability.podspec'
end end
end end
describe 'http source' do
it 'raises an Informative error if the specified url fails to load' do
@subject.stubs(:params).returns(:podspec => 'https://github.com/username/TSMessages/TSMessages.podspec')
WebMock::API.stub_request(:get, 'https://github.com/username/TSMessages/TSMessages.podspec').
to_return(:status => 404)
lambda { @subject.fetch(config.sandbox) }.should.raise(Informative).
message.should.match(/Failed to fetch podspec for/)
WebMock.reset!
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