-
-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# frozen_string_literal: true | ||
|
||
$TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), '../..')) | ||
|
||
require 'fileutils' | ||
|
||
RSpec.describe YARD::CLI::Yardoc do | ||
include FileUtils | ||
|
||
context 'building the documentation of YARD itself' do | ||
before(:context) do | ||
rm_rf File.join($TOPDIR, 'doc') | ||
rm_rf File.join($TOPDIR, '.yardoc') | ||
|
||
# Note: as this is very time consuming, we do it only once | ||
Dir.chdir($TOPDIR) do | ||
@res = YARD::CLI::Yardoc.new.run('--title', 'YARD-On-YARD') | ||
end | ||
end | ||
|
||
it 'succeeds and creates doc/ and .yardoc/' do | ||
expect(@res).to be true | ||
expect(Dir.exist?('doc')).to be true | ||
expect(Dir.exist?('.yardoc')).to be true | ||
end | ||
|
||
it 'writes the given title in each documentation file' do | ||
Dir.glob(File.join($TOPDIR, 'doc/**/*.html')) do |htmlfile| | ||
next if %w( | ||
frames file_list class_list method_list tag_list _index | ||
).include?(File.basename(htmlfile, '.html')) | ||
html = File.read(htmlfile) | ||
|
||
expect(html.index('— YARD-On-YARD')).to be >= 0 | ||
end | ||
end | ||
end | ||
end if ENV['CI'] || ENV['YY'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters