Commit cc2fc7e1 authored by Fabio Pelosin's avatar Fabio Pelosin

[ExternalSources::PathSource] Fix relative path detection

Closes https://github.com/CocoaPods/CocoaPods/issues/2050
parent 583d5448
......@@ -19,7 +19,7 @@ module Pod
"`#{declared_path}`"
end
store_podspec(sandbox, podspec)
is_absolute = absolute?(podspec)
is_absolute = absolute?(declared_path)
sandbox.store_local_path(name, podspec.dirname, is_absolute)
end
end
......
......@@ -42,6 +42,22 @@ module Pod
should.raise Informative do
@subject.fetch(config.sandbox)
end.message.should.match /No podspec found for `Reachability` in `#{temporary_directory}`/
it "marks a pod as relative" do
@subject.stubs(:params).returns(:path => './Reachability')
Pathname.any_instance.stubs(:exist?).returns(true)
config.sandbox.stubs(:store_podspec)
@subject.fetch(config.sandbox)
config.sandbox.local_path_was_absolute?('Reachability').should.be.false
end
it "marks a pod as absolute" do
@subject.stubs(:params).returns(:path => '/path/Reachability')
Pathname.any_instance.stubs(:exist?).returns(true)
config.sandbox.stubs(:store_podspec)
@subject.fetch(config.sandbox)
config.sandbox.local_path_was_absolute?('Reachability').should.be.true
end
end
describe "#podspec_path" do
......@@ -79,6 +95,11 @@ module Pod
result.should.be.false
end
it "consider relative paths not explicitly set from the current dir" do
result = @subject.send(:absolute?, './ThirdPartyCode/UrbanAirship')
result.should.be.false
end
it 'returns that a path is absolute' do
result = @subject.send(:absolute?, '/path/to/UrbanAirship')
result.should.be.true
......
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