diff --git a/test/rdoc/support/text_formatter_test_case.rb b/test/rdoc/support/text_formatter_test_case.rb index 9b3d7ed626..5a51b16fd7 100644 --- a/test/rdoc/support/text_formatter_test_case.rb +++ b/test/rdoc/support/text_formatter_test_case.rb @@ -103,13 +103,13 @@ def test_accept_paragraph_wrap # Test case that calls @to.accept_table def test_accept_table_align - header = ['AA', 'BB', 'CCCCC'] + header = ['AA', 'BB', 'CCCCC', 'DDDDD'] body = [ - ['', 'bbb', 'c'], - ['aaaa', 'b', ''], - ['a', '', 'cc'] + ['', 'bbb', 'c', ''], + ['aaaa', 'b', '', 'dd'], + ['a', '', 'cc', 'dd'] ] - aligns = [nil, :left, :right] + aligns = [nil, :left, :right, :center] @to.start_accepting @to.accept_table header, body, aligns diff --git a/test/rdoc/test_rdoc_markup_to_ansi.rb b/test/rdoc/test_rdoc_markup_to_ansi.rb index 893040cb44..020f546997 100644 --- a/test/rdoc/test_rdoc_markup_to_ansi.rb +++ b/test/rdoc/test_rdoc_markup_to_ansi.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require_relative 'helper' -class TestRDocMarkupToAnsi < RDoc::Markup::TextFormatterTestCase +class RDocMarkupToAnsiTest < RDoc::Markup::TextFormatterTestCase add_visitor_tests add_text_tests @@ -350,11 +350,11 @@ def list_verbatim def accept_table_align expected = "\e[0m" + <<-EXPECTED - AA |BB |CCCCC -----|---|----- - |bbb| c -aaaa|b | - a | | cc + AA |BB |CCCCC|DDDDD +----|---|-----|----- + |bbb| c| +aaaa|b | | dd + a | | cc| dd EXPECTED assert_equal expected, @to.end_accepting end diff --git a/test/rdoc/test_rdoc_markup_to_bs.rb b/test/rdoc/test_rdoc_markup_to_bs.rb index 93baa6b59f..d89d784422 100644 --- a/test/rdoc/test_rdoc_markup_to_bs.rb +++ b/test/rdoc/test_rdoc_markup_to_bs.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require_relative 'helper' -class TestRDocMarkupToBs < RDoc::Markup::TextFormatterTestCase +class RDocMarkupToBsTest < RDoc::Markup::TextFormatterTestCase add_visitor_tests add_text_tests @@ -351,11 +351,11 @@ def list_verbatim def accept_table_align expected = <<-EXPECTED - AA |BB |CCCCC -----|---|----- - |bbb| c -aaaa|b | - a | | cc + AA |BB |CCCCC|DDDDD +----|---|-----|----- + |bbb| c| +aaaa|b | | dd + a | | cc| dd EXPECTED assert_equal expected, @to.end_accepting end diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb index 225598a651..ffd16f0837 100644 --- a/test/rdoc/test_rdoc_markup_to_html.rb +++ b/test/rdoc/test_rdoc_markup_to_html.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require_relative 'helper' -class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase +class RDocMarkupToHtmlTest < RDoc::Markup::FormatterTestCase add_visitor_tests @@ -956,31 +956,34 @@ def util_format text end def test_accept_table - header = %w[Col1 Col2 Col3] + header = %w[Col1 Col2 Col3 Col4] body = [ - %w[cell1_1 cell1_2 cell1_3], - %w[cell2_1 cell2_2 cell2_3], - ['',], - %w[+code+ _em_ **strong**], + %w[cell1_1 cell1_2 cell1_3 cell1_4], + %w[cell2_1 cell2_2 cell2_3 cell2_4], + [''], + %w[+code+ _em_ **strong** C1], ] - aligns = [:left, :right, nil] + aligns = [:left, :right, nil, :center] @to.start_accepting @to.accept_table(header, body, aligns) res = @to.end_accepting assert_include(res[%r<]*>Col1>], 'align="left"') assert_include(res[%r<]*>Col2>], 'align="right"') assert_not_include(res[%r<]*>Col3>], 'align=') + assert_include(res[%r<]*>Col4>], 'align="center"') assert_include(res[%r<]*>cell1_1>], 'align="left"') assert_include(res[%r<]*>cell1_2>], 'align="right"') assert_not_include(res[%r<]*>cell1_3>], 'align=') assert_include(res[%r<]*>cell2_1>], 'align="left"') assert_include(res[%r<]*>cell2_2>], 'align="right"') assert_not_include(res[%r<]*>cell2_3>], 'align=') + assert_include(res[%r<]*>cell2_4>], 'align="center"') assert_not_include(res, '