Commit 65009432 authored by Eloy Duran's avatar Eloy Duran

Only actually run appledoc from specs if it's installed.

Which one should normally do, but it won't be available on Travis.
parent 7b68080f
module Pod module Pod
class DocsGenerator class DocsGenerator
def self.appledoc_installed?
!`which appledoc`.strip.empty?
end
attr_reader :pod, :specification, :target_path, :options attr_reader :pod, :specification, :target_path, :options
def initialize(pod) def initialize(pod)
...@@ -78,9 +82,8 @@ module Pod ...@@ -78,9 +82,8 @@ module Pod
end end
def appledoc (options) def appledoc (options)
bin = `which appledoc`.strip unless self.class.appledoc_installed?
if bin.empty? puts "\n[!] Skipping documentation generation because appledoc can't be found." if Config.instance.verbose?
puts "\n[!] Skipping documenation generation because appledoc can't be found." if Config.instance.verbose?
return return
end end
arguments = [] arguments = []
......
...@@ -129,21 +129,23 @@ else ...@@ -129,21 +129,23 @@ else
change_log.should.not.include '1.3' change_log.should.not.include '1.3'
end end
it "generates documentation of all pods by default" do if Pod::DocsGenerator.appledoc_installed?
podfile = Pod::Podfile.new do it "generates documentation of all pods by default" do
self.platform :ios podfile = Pod::Podfile.new do
dependency 'JSONKit', '1.4' self.platform :ios
dependency 'SSToolkit' dependency 'JSONKit', '1.4'
end dependency 'SSToolkit'
end
installer = SpecHelper::Installer.new(podfile)
installer.install!
File.directory?(config.project_pods_root + 'Documentation/JSONKit/html/')
doc = (config.project_pods_root + 'Documentation/SSToolkit/html/index.html').read
doc.should.include?('SSToolkit')
installer = SpecHelper::Installer.new(podfile)
installer.install!
File.directory?(config.project_pods_root + 'Documentation/JSONKit/html/')
doc = (config.project_pods_root + 'Documentation/SSToolkit/html/index.html').read
doc.should.include?('SSToolkit')
end
else
puts "[!] Skipping documentation generation specs, because appledoc can't be found."
end end
end end
......
...@@ -44,16 +44,20 @@ describe Pod::DocsGenerator do ...@@ -44,16 +44,20 @@ describe Pod::DocsGenerator do
] ]
end end
it 'it creates the documenation directory' do if Pod::DocsGenerator.appledoc_installed?
File.directory?(@sandbox.root + "Documentation").should.be.true it 'it creates the documenation directory' do
end File.directory?(@sandbox.root + "Documentation").should.be.true
end
it 'it creates the html' do
File.directory?(@sandbox.root + "Documentation/BananaLib/html").should.be.true it 'it creates the html' do
index = (@sandbox.root + 'Documentation/BananaLib/html/index.html').read File.directory?(@sandbox.root + "Documentation/BananaLib/html").should.be.true
index.should.include?('BananaObj') index = (@sandbox.root + 'Documentation/BananaLib/html/index.html').read
index = (@sandbox.root + 'Documentation/BananaLib/html/Classes/BananaObj.html').read index.should.include?('BananaObj')
index.should.include?('Bananas are cool') index = (@sandbox.root + 'Documentation/BananaLib/html/Classes/BananaObj.html').read
index.should.include?('Bananas are cool')
end
else
puts "[!] Skipping documentation generation specs, because appledoc can't be found."
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