Commit c37de717 authored by Eloy Durán's avatar Eloy Durán

Merge pull request #768 from drodriguez/gh-708-podspec-nil-options

Fix podspec in Podfile with no options.
parents 1990ff72 da643ea1
......@@ -403,7 +403,7 @@ module Pod
name = File.extname(name) == '.podspec' ? name : "#{name}.podspec"
file = config.project_root + name
else
file = config.project_root.glob('*.podspec').first
file = Pathname.glob(config.project_root + '*.podspec').first
end
spec = Specification.from_file(file)
......
Pod::Spec.new do |s|
s.name = 'FirstLib'
s.version = '1.0'
s.homepage = 'https://firstlib.local/firstlib'
s.summary = 'The First Lib'
s.authors = { 'First Lib Creator' => 'creator@firstlib.local' }
s.source = { :git => 'https://firstlib.local/firstlib.git', :tag => '1.0' }
s.source_files = 'Classes/*.{h,m}'
s.license = 'MIT'
s.dependency 'FirstDep'
end
Pod::Spec.new do |s|
s.name = 'SecondLib'
s.version = '1.0'
s.homepage = 'https://secondlib.local/secondlib'
s.summary = 'The Second Lib'
s.authors = { 'Second Lib Creator' => 'creator@secondlib.local' }
s.source = { :git => 'https://secondlib.local/secondlib.git', :tag => '1.0' }
s.source_files = 'Classes/*.{h,m}'
s.license = 'MIT'
s.dependency 'SecondDep'
end
......@@ -341,16 +341,59 @@ describe "Pod::Podfile" do
end
end
describe "concerning the podspec method" do
xit "it can use use the dependencies of a podspec" do
before do
FileUtils.cp(fixture('podspecs/1st.podspec'), config.project_root)
FileUtils.cp(fixture('podspecs/2nd.podspec'), config.project_root)
end
it "it uses the first podspec in the project root by default" do
podfile = Pod::Podfile.new do
platform :ios
podspec
end
podfile.dependencies.size.should == 1
podfile.dependency_by_top_level_spec_name('FirstDep').should == Pod::Dependency.new('FirstDep')
end
it "it allows to specify the name of a podspec" do
podfile = Pod::Podfile.new do
platform :ios
podspec :name => '2nd.podspec'
end
podfile.dependencies.size.should == 1
podfile.dependency_by_top_level_spec_name('SecondDep').should == Pod::Dependency.new('SecondDep')
end
xit "it allows to specify the name of a podspec" do
it "it allows to specify the name of a podspec without extension" do
podfile = Pod::Podfile.new do
platform :ios
podspec :name => '2nd'
end
podfile.dependencies.size.should == 1
podfile.dependency_by_top_level_spec_name('SecondDep').should == Pod::Dependency.new('SecondDep')
end
it "it allows to specify the path of a podspec" do
podfile = Pod::Podfile.new do
platform :ios
podspec :path => (config.project_root + '2nd.podspec').to_s
end
podfile.dependencies.size.should == 1
podfile.dependency_by_top_level_spec_name('SecondDep').should == Pod::Dependency.new('SecondDep')
end
xit "it allows to specify the path of a podspec" do
it "it allows to specify the path of a podspec without extension" do
podfile = Pod::Podfile.new do
platform :ios
podspec :path => (config.project_root + '2nd').to_s
end
podfile.dependencies.size.should == 1
podfile.dependency_by_top_level_spec_name('SecondDep').should == Pod::Dependency.new('SecondDep')
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