summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/api_test.rb16
-rw-r--r--test/document_test.rb92
-rw-r--r--test/extensions_test.rb14
-rw-r--r--test/lists_test.rb4
-rw-r--r--test/manpage_test.rb20
-rw-r--r--test/preamble_test.rb40
-rw-r--r--test/tables_test.rb2
-rw-r--r--test/test_helper.rb6
8 files changed, 97 insertions, 97 deletions
diff --git a/test/api_test.rb b/test/api_test.rb
index a11f6920..075ca919 100644
--- a/test/api_test.rb
+++ b/test/api_test.rb
@@ -1264,8 +1264,8 @@ context 'API' do
test 'should embed default stylesheet if safe mode is less than SECURE and linkcss is unset from API' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, standalone: true, to_file: false,
- safe: Asciidoctor::SafeMode::SAFE, attributes: { 'linkcss!' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ standalone: true, to_file: false, safe: Asciidoctor::SafeMode::SAFE, attributes: { 'linkcss!' => '' }
assert_css 'html:root > head > style', output, 1
stylenode = xmlnodes_at_css 'html:root > head > style', output, 1
styles = stylenode.content
@@ -1313,8 +1313,8 @@ context 'API' do
test 'should resolve custom stylesheet to embed relative to stylesdir' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, standalone: true, safe: Asciidoctor::SafeMode::SAFE, to_file: false,
- attributes: { 'stylesheet' => 'custom.css', 'stylesdir' => './stylesheets', 'linkcss!' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ standalone: true, safe: Asciidoctor::SafeMode::SAFE, to_file: false, attributes: { 'stylesheet' => 'custom.css', 'stylesdir' => './stylesheets', 'linkcss!' => '' }
stylenode = xmlnodes_at_css 'html:root > head > style', output, 1
styles = stylenode.content
refute_nil styles
@@ -1361,8 +1361,8 @@ context 'API' do
sample_input_path = fixture_path 'sample.adoc'
sample_output_path = File.join output_dir, 'sample.html'
custom_stylesheet_output_path = File.join output_dir, 'stylesheets', 'custom.css'
- Asciidoctor.convert_file sample_input_path, safe: :safe, to_dir: output_dir, mkdirs: true,
- attributes: { 'stylesheet' => 'stylesheets/custom.css', 'linkcss' => '', 'copycss' => '' }
+ Asciidoctor.convert_file sample_input_path,
+ safe: :safe, to_dir: output_dir, mkdirs: true, attributes: { 'stylesheet' => 'stylesheets/custom.css', 'linkcss' => '', 'copycss' => '' }
assert File.exist? sample_output_path
assert File.exist? custom_stylesheet_output_path
output = File.read sample_output_path, mode: Asciidoctor::FILE_READ_MODE
@@ -1379,8 +1379,8 @@ context 'API' do
sample_input_path = fixture_path 'sample.adoc'
sample_output_path = File.join output_dir, 'sample.html'
custom_stylesheet_output_path = File.join output_dir, 'custom.css'
- Asciidoctor.convert_file sample_input_path, safe: :safe, to_dir: output_dir, mkdirs: true,
- attributes: { 'stylesheet' => 'custom.css', 'linkcss' => true, 'copycss' => true }
+ Asciidoctor.convert_file sample_input_path,
+ safe: :safe, to_dir: output_dir, mkdirs: true, attributes: { 'stylesheet' => 'custom.css', 'linkcss' => true, 'copycss' => true }
assert File.exist? sample_output_path
assert File.exist? custom_stylesheet_output_path
output = File.read sample_output_path, mode: Asciidoctor::FILE_READ_MODE
diff --git a/test/document_test.rb b/test/document_test.rb
index 62733fb9..c02d6ff6 100644
--- a/test/document_test.rb
+++ b/test/document_test.rb
@@ -150,8 +150,8 @@ context 'Document' do
}
cases.each do |attr_val, markup|
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: %(linkcss copycss! #{attr_val})
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: %(linkcss copycss! #{attr_val})
refute_empty output
assert_css 'script[src="modernizr.js"]', output, markup[:head_script]
assert_css 'meta[http-equiv="imagetoolbar"]', output, markup[:meta]
@@ -164,8 +164,8 @@ context 'Document' do
test 'should include docinfo header even if noheader attribute is set' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => 'private-header', 'noheader' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => 'private-header', 'noheader' => '' }
refute_empty output
assert_css 'body > nav.navbar', output, 1
assert_css 'body > nav.navbar + #content', output, 1
@@ -173,8 +173,8 @@ context 'Document' do
test 'should include docinfo footer even if nofooter attribute is set' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '', 'nofooter' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '', 'nofooter' => '' }
refute_empty output
assert_css 'body > a#top', output, 1
end
@@ -182,8 +182,8 @@ context 'Document' do
test 'should include user docinfo after built-in docinfo' do
sample_input_path = fixture_path 'basic.adoc'
attrs = { 'docinfo' => 'shared', 'source-highlighter' => 'highlight.js', 'linkcss' => '', 'copycss' => nil }
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: :safe, attributes: attrs
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: :safe, attributes: attrs
assert_css 'link[rel=stylesheet] + meta[http-equiv=imagetoolbar]', output, 1
assert_css 'meta[http-equiv=imagetoolbar] + *', output, 0
assert_css 'script + a#top', output, 1
@@ -193,26 +193,26 @@ context 'Document' do
test 'should include docinfo files for html backend with custom docinfodir' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '', 'docinfodir' => 'custom-docinfodir' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '', 'docinfodir' => 'custom-docinfodir' }
refute_empty output
assert_css 'script[src="bootstrap.js"]', output, 1
assert_css 'meta[name="robots"]', output, 0
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '', 'docinfodir' => 'custom-docinfodir' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '', 'docinfodir' => 'custom-docinfodir' }
refute_empty output
assert_css 'script[src="bootstrap.js"]', output, 0
assert_css 'meta[name="robots"]', output, 1
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '', 'docinfodir' => './custom-docinfodir' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '', 'docinfodir' => './custom-docinfodir' }
refute_empty output
assert_css 'script[src="bootstrap.js"]', output, 1
assert_css 'meta[name="robots"]', output, 1
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '', 'docinfodir' => 'custom-docinfodir/subfolder' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '', 'docinfodir' => 'custom-docinfodir/subfolder' }
refute_empty output
assert_css 'script[src="bootstrap.js"]', output, 0
assert_css 'meta[name="robots"]', output, 0
@@ -221,14 +221,14 @@ context 'Document' do
test 'should include docinfo files in docbook backend' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '' }
refute_empty output
assert_css 'productname', output, 0
assert_css 'copyright', output, 1
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '' }
refute_empty output
assert_css 'productname', output, 1
assert_xpath '//xmlns:productname[text()="Asciidoctor™"]', output, 1
@@ -236,8 +236,8 @@ context 'Document' do
assert_xpath '//xmlns:edition[text()="1.0"]', output, 1 # verifies substitutions are performed
assert_css 'copyright', output, 0
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '' }
refute_empty output
assert_css 'productname', output, 1
assert_xpath '//xmlns:productname[text()="Asciidoctor™"]', output, 1
@@ -247,8 +247,8 @@ context 'Document' do
end
test 'should use header docinfo in place of default header' do
- output = Asciidoctor.convert_file fixture_path('sample.adoc'), to_file: false,
- standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => 'private-header', 'noheader' => '' }
+ output = Asciidoctor.convert_file fixture_path('sample.adoc'),
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => 'private-header', 'noheader' => '' }
refute_empty output
assert_css 'article > info', output, 1
assert_css 'article > info > title', output, 1
@@ -259,20 +259,20 @@ context 'Document' do
test 'should include docinfo footer files for html backend' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '' }
refute_empty output
assert_css 'body script', output, 1
assert_css 'a#top', output, 0
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '' }
refute_empty output
assert_css 'body script', output, 0
assert_css 'a#top', output, 1
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '' }
refute_empty output
assert_css 'body script', output, 1
assert_css 'a#top', output, 1
@@ -281,21 +281,21 @@ context 'Document' do
test 'should include docinfo footer files in DocBook backend' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '' }
refute_empty output
assert_css 'article > revhistory', output, 1
assert_xpath '/xmlns:article/xmlns:revhistory/xmlns:revision/xmlns:revnumber[text()="1.0"]', output, 1 # verifies substitutions are performed
assert_css 'glossary', output, 0
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo1' => '' }
refute_empty output
assert_css 'article > revhistory', output, 0
assert_css 'glossary[xml|id="_glossary"]', output, 1
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo2' => '' }
refute_empty output
assert_css 'article > revhistory', output, 1
assert_xpath '/xmlns:article/xmlns:revhistory/xmlns:revision/xmlns:revnumber[text()="1.0"]', output, 1 # verifies substitutions are performed
@@ -311,8 +311,8 @@ context 'Document' do
$VERBOSE = nil # disable warnings since we have to modify constants
Encoding.default_external = Encoding.default_internal = Encoding::IBM437
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false, standalone: true,
- backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => 'private,shared' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => 'private,shared' }
refute_empty output
assert_css 'productname', output, 1
assert_includes output, '<productname>Asciidoctor™</productname>'
@@ -329,14 +329,14 @@ context 'Document' do
test 'should not include docinfo files by default' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, safe: Asciidoctor::SafeMode::SERVER
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER
refute_empty output
assert_css 'script[src="modernizr.js"]', output, 0
assert_css 'meta[http-equiv="imagetoolbar"]', output, 0
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', safe: Asciidoctor::SafeMode::SERVER
refute_empty output
assert_css 'productname', output, 0
assert_css 'copyright', output, 0
@@ -345,14 +345,14 @@ context 'Document' do
test 'should not include docinfo files if safe mode is SECURE or greater' do
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, attributes: { 'docinfo2' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, attributes: { 'docinfo2' => '' }
refute_empty output
assert_css 'script[src="modernizr.js"]', output, 0
assert_css 'meta[http-equiv="imagetoolbar"]', output, 0
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true, backend: 'docbook', attributes: { 'docinfo2' => '' }
+ output = Asciidoctor.convert_file sample_input_path,
+ to_file: false, standalone: true, backend: 'docbook', attributes: { 'docinfo2' => '' }
refute_empty output
assert_css 'productname', output, 0
assert_css 'copyright', output, 0
diff --git a/test/extensions_test.rb b/test/extensions_test.rb
index 0c61068c..0e2bf725 100644
--- a/test/extensions_test.rb
+++ b/test/extensions_test.rb
@@ -115,7 +115,8 @@ class StripAttributesPostprocessor < Asciidoctor::Extensions::Postprocessor
end
end
-class UppercaseBlock < Asciidoctor::Extensions::BlockProcessor; use_dsl
+class UppercaseBlock < Asciidoctor::Extensions::BlockProcessor
+ use_dsl
named :yell
on_context :paragraph
name_positional_attributes 'chars'
@@ -143,7 +144,8 @@ class LegacyPosAttrsBlockMacro < Asciidoctor::Extensions::BlockMacroProcessor
end
end
-class TemperatureMacro < Asciidoctor::Extensions::InlineMacroProcessor; use_dsl
+class TemperatureMacro < Asciidoctor::Extensions::InlineMacroProcessor
+ use_dsl
named :degrees
resolve_attributes '1:units', 'precision=1'
def process parent, target, attributes
@@ -167,7 +169,8 @@ class MetaRobotsDocinfoProcessor < Asciidoctor::Extensions::DocinfoProcessor
end
end
-class MetaAppDocinfoProcessor < Asciidoctor::Extensions::DocinfoProcessor; use_dsl
+class MetaAppDocinfoProcessor < Asciidoctor::Extensions::DocinfoProcessor
+ use_dsl
at_location :head
def process document
@@ -1754,10 +1757,7 @@ context 'Extensions' do
end
sample_input_path = fixture_path('basic.adoc')
- output = Asciidoctor.convert_file sample_input_path, to_file: false,
- standalone: true,
- safe: Asciidoctor::SafeMode::SERVER,
- attributes: { 'docinfo' => '' }
+ output = Asciidoctor.convert_file sample_input_path, to_file: false, standalone: true, safe: Asciidoctor::SafeMode::SERVER, attributes: { 'docinfo' => '' }
refute_empty output
assert_css 'script[src="modernizr.js"]', output, 1
assert_css 'meta[name="robots"]', output, 1
diff --git a/test/lists_test.rb b/test/lists_test.rb
index 4b0762c6..148e0314 100644
--- a/test/lists_test.rb
+++ b/test/lists_test.rb
@@ -1755,8 +1755,8 @@ context 'Bulleted lists (:ulist)' do
end
end
- # NOTE this is not consistent w/ AsciiDoc output, but this is some screwy input anyway
=begin
+ # NOTE this is not consistent w/ AsciiDoc output, but this is some screwy input anyway
test 'consecutive list continuation lines are folded' do
input = <<~'EOS'
Lists
@@ -4070,8 +4070,8 @@ context 'Description lists redux' do
assert_includes output, 'not a term::: def'
end
- # FIXME pending
=begin
+ # FIXME pending
test 'attached paragraph does not break on adjacent sibling description list term' do
input = <<~'EOS'
term1:: def
diff --git a/test/manpage_test.rb b/test/manpage_test.rb
index 21f08827..6a6ed9ea 100644
--- a/test/manpage_test.rb
+++ b/test/manpage_test.rb
@@ -294,10 +294,10 @@ context 'Manpage' do
#{SAMPLE_MANPAGE_HEADER}
-x::
- Ao gravar o commit, acrescente uma linha que diz "(cherry picked from commit
- ...)" à mensagem de commit original para indicar qual commit esta mudança
- foi escolhida. Isso é feito apenas para picaretas de cereja sem conflitos.
- EOS
+ Ao gravar o commit, acrescente uma linha que diz "(cherry picked from commit
+ ...)" à mensagem de commit original para indicar qual commit esta mudança
+ foi escolhida. Isso é feito apenas para picaretas de cereja sem conflitos.
+ EOS
output = Asciidoctor.convert input, backend: :manpage
assert_equal '\&...', output.lines[-3][0..4].chomp
end
@@ -307,12 +307,12 @@ context 'Manpage' do
#{SAMPLE_MANPAGE_HEADER}
-x::
- Ao gravar o commit, acrescente uma linha que diz
- "(cherry picked from commit...)" à mensagem de commit
- original para indicar qual commit esta mudança
- foi escolhida. Isso é feito apenas para picaretas
- de cereja sem conflitos.
- EOS
+ Ao gravar o commit, acrescente uma linha que diz
+ "(cherry picked from commit...)" à mensagem de commit
+ original para indicar qual commit esta mudança
+ foi escolhida. Isso é feito apenas para picaretas
+ de cereja sem conflitos.
+ EOS
output = Asciidoctor.convert input, backend: :manpage
assert(output.lines[-5].include? 'commit...')
end
diff --git a/test/preamble_test.rb b/test/preamble_test.rb
index b4c132c8..3896b460 100644
--- a/test/preamble_test.rb
+++ b/test/preamble_test.rb
@@ -115,36 +115,36 @@ context 'Preamble' do
end
test 'preamble in book doctype' do
- input = <<~'EOS'
- = Book
- :doctype: book
+ input = <<~'EOS'
+ = Book
+ :doctype: book
- Back then...
+ Back then...
- = Chapter One
+ = Chapter One
- [partintro]
- It was a dark and stormy night...
+ [partintro]
+ It was a dark and stormy night...
- == Scene One
+ == Scene One
- Someone's gonna get axed.
+ Someone's gonna get axed.
- = Chapter Two
+ = Chapter Two
- [partintro]
- They couldn't believe their eyes when...
+ [partintro]
+ They couldn't believe their eyes when...
- == Scene One
+ == Scene One
- The axe came swinging.
- EOS
+ The axe came swinging.
+ EOS
- d = document_from_string(input)
- assert_equal 'book', d.doctype
- output = d.convert
- assert_xpath '//h1', output, 3
- assert_xpath %{//*[@id="preamble"]//p[text() = "Back then#{decode_char 8230}#{decode_char 8203}"]}, output, 1
+ d = document_from_string(input)
+ assert_equal 'book', d.doctype
+ output = d.convert
+ assert_xpath '//h1', output, 3
+ assert_xpath %{//*[@id="preamble"]//p[text() = "Back then#{decode_char 8230}#{decode_char 8203}"]}, output, 1
end
test 'should output table of contents in preamble if toc-placement attribute value is preamble' do
diff --git a/test/tables_test.rb b/test/tables_test.rb
index 5ddde1d3..9e4ad71d 100644
--- a/test/tables_test.rb
+++ b/test/tables_test.rb
@@ -2280,7 +2280,7 @@ context 'Tables' do
end
test 'should not drop trailing empty cell in TSV data when loaded from an include file' do
- input = <<~'EOS'
+ input = <<~'EOS'
[%header,format=tsv]
|===
include::fixtures/data.tsv[]
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 260159e0..af9b7ea5 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -409,10 +409,10 @@ class Minitest::Test
session.print %(HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n)
session.print %({"name": "asciidoctor"}\n)
elsif File.file?(resource_file = (File.join base_dir, resource))
- mimetype = if (ext = File.extname(resource_file)[1..-1])
- ext == 'adoc' ? 'text/plain' : %(image/#{ext})
+ if (ext = File.extname(resource_file)[1..-1])
+ mimetype = ext == 'adoc' ? 'text/plain' : %(image/#{ext})
else
- 'text/plain'
+ mimetype = 'text/plain'
end
session.print %(HTTP/1.1 200 OK\r\nContent-Type: #{mimetype}\r\n\r\n)
File.open resource_file, Asciidoctor::FILE_READ_MODE do |fd|