Skip to content

Commit

Permalink
Add test for documentation coverage (jjochen#101)
Browse files Browse the repository at this point in the history
* Add test for documentation coverage

* Update rake task title
  • Loading branch information
jjochen authored Jan 8, 2018
1 parent bfe71e1 commit 8eb0bf9
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,15 @@ begin
desc 'Build documentation'
task :build_documentation do
generate_documentation
test_documentation_coverage
end



desc 'Test documentation coverage'
task :test_documentation_coverage do
test_documentation_coverage
end


#-- Changelog --------------------------------------------------------------#

desc 'Generate changelog'
Expand Down Expand Up @@ -270,6 +276,18 @@ def generate_documentation
sh 'bundle exec jazzy'
end

def test_documentation_coverage
title 'Checking documentation coverage'
file_path = './docs/index.html'
search_string = '100% documented'
if File.foreach(file_path).grep(/#{Regexp.escape(search_string)}/).any?
puts "'#{search_string}' found in #{file_path}"
else
error_message "'#{search_string}' not found in #{file_path}"
exit 1
end
end

def update_version_in_podspec(version)
title "Updating version in podspec"
check_parameter(version)
Expand Down

0 comments on commit 8eb0bf9

Please sign in to comment.