Commit 583d5448 authored by Fabio Pelosin's avatar Fabio Pelosin

[ExternalSources::PathSource] Add specs for relative path detection

parent 23aece25
...@@ -37,15 +37,14 @@ module Pod ...@@ -37,15 +37,14 @@ module Pod
} }
end end
it "raises if the podspec cannot be found" do it "raises if the podspec cannot be found" do
@subject.stubs(:params).returns(:path => temporary_directory) @subject.stubs(:params).returns(:path => temporary_directory)
should.raise Informative do should.raise Informative do
@subject.fetch(config.sandbox) @subject.fetch(config.sandbox)
end.message.should.match /No podspec found for `Reachability` in `#{temporary_directory}`/ end.message.should.match /No podspec found for `Reachability` in `#{temporary_directory}`/
end end
describe "Helpers" do
describe "#podspec_path" do
it "handles absolute paths" do it "handles absolute paths" do
@subject.stubs(:params).returns(:path => fixture('integration/Reachability')) @subject.stubs(:params).returns(:path => fixture('integration/Reachability'))
path = @subject.send(:podspec_path) path = @subject.send(:podspec_path)
...@@ -73,6 +72,23 @@ module Pod ...@@ -73,6 +72,23 @@ module Pod
path.should == Pathname(ENV['HOME']) + 'Reachability/Reachability.podspec' path.should == Pathname(ENV['HOME']) + 'Reachability/Reachability.podspec'
end end
end end
describe '#absolute?' do
it 'returns that a path is relative' 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
end
it 'considers absolute paths specified with the tilde' do
result = @subject.send(:absolute?, '~/path/to/UrbanAirship')
result.should.be.true
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