diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2019-02-10 15:36:55 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2019-02-10 15:36:55 -0700 |
| commit | 65c83533fbcd7f7f270d041d0b8ab50e4f26641b (patch) | |
| tree | df30af13fd7bd3eda9533304e152b068ab845101 /test | |
| parent | afb1c126ffea7ae4bff82047bbcca3a5bcc8d7a5 (diff) | |
add test to verify start line number is set to 1 by default
Diffstat (limited to 'test')
| -rw-r--r-- | test/syntax_highlighter_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/syntax_highlighter_test.rb b/test/syntax_highlighter_test.rb index 9f01f7e1..bc33e60c 100644 --- a/test/syntax_highlighter_test.rb +++ b/test/syntax_highlighter_test.rb @@ -648,6 +648,23 @@ context 'Syntax Highlighter' do assert_css 'code span.gp', output, 1 end + test 'should set starting line number to 1 by default in HTML output if linenums option is enabled' do + input = <<~'EOS' + [source%linenums,ruby] + ---- + puts 'Hello, World!' + puts 'Goodbye, World!' + ---- + EOS + output = convert_string_to_embedded input, attributes: { 'source-highlighter' => 'rouge' } + assert_css 'table.linenotable', output, 1 + assert_css 'table.linenotable td.linenos', output, 1 + assert_css 'table.linenotable td.linenos pre.lineno', output, 1 + assert_css 'table.linenotable td.code', output, 1 + assert_css 'table.linenotable td.code pre:not([class])', output, 1 + assert_xpath %(//pre[@class="lineno"][text()="1\n2\n"]), output, 1 + end + test 'should set starting line number in HTML output if linenums option is enabled and start attribute is set' do input = <<~'EOS' [source%linenums,ruby,start=9] |
