File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require 'fileutils'
4+ require 'yard'
45
56# Class for generating documentation of all cops departments
67# @api private
@@ -295,7 +296,7 @@ def print_cops_of_department(department)
295296 HEADER
296297 selected_cops . each { |cop | content << print_cop_with_doc ( cop ) }
297298 content << footer_for_department ( department )
298- file_name = "#{ docs_path } / #{ department_to_basename ( department ) } .adoc"
299+ file_name = "#{ docs_path } #{ department_to_basename ( department ) } .adoc"
299300 File . open ( file_name , 'w' ) do |file |
300301 puts "* generated #{ file_name } "
301302 file . write ( "#{ content . strip } \n " )
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'rubocop/cops_documentation_generator'
4+
5+ RSpec . describe CopsDocumentationGenerator , :isolated_environment do
6+ around do |example |
7+ new_global = RuboCop ::Cop ::Registry . new ( [ RuboCop ::Cop ::Style ::HashSyntax ] )
8+ RuboCop ::Cop ::Registry . with_temporary_global ( new_global ) { example . run }
9+ end
10+
11+ it 'generates docs without errors' do
12+ generator = described_class . new ( departments : %w[ Style ] )
13+ expect do
14+ generator . call
15+ end . to output ( %r{generated .*docs/modules/ROOT/pages/cops_style.adoc} ) . to_stdout
16+ end
17+ end
You can’t perform that action at this time.
0 commit comments