test/text_test.rb in asciidoctor-1.5.5 vs test/text_test.rb in asciidoctor-1.5.6
- old
+ new
@@ -33,21 +33,21 @@
test 'proper encoding to handle utf8 characters in arbitrary block' do
input = []
input << "[verse]\n"
input.concat(File.readlines(sample_doc_path(:encoding)))
doc = empty_document
- reader = Asciidoctor::PreprocessorReader.new doc, input
+ reader = Asciidoctor::PreprocessorReader.new doc, input, nil, :normalize => true
block = Asciidoctor::Parser.next_block(reader, doc)
assert_xpath '//pre', block.render.gsub(/^\s*\n/, ''), 1
end
test 'proper encoding to handle utf8 characters from included file' do
input = <<-EOS
include::fixtures/encoding.asciidoc[tags=romé]
EOS
doc = empty_safe_document :base_dir => File.expand_path(File.dirname(__FILE__))
- reader = Asciidoctor::PreprocessorReader.new doc, input
+ reader = Asciidoctor::PreprocessorReader.new doc, input, nil, :normalize => true
block = Asciidoctor::Parser.next_block(reader, doc)
output = block.render
assert_css '.paragraph', output, 1
end
@@ -143,11 +143,11 @@
]
bad_variants.each do |variant|
good_offsets.each do |offset|
input = <<-EOS
-This line is separated something that is not a horizontal rule...
+This line is separated by something that is not a horizontal rule...
#{offset}#{variant}
...from this line.
EOS
@@ -168,11 +168,11 @@
]
good_variants.each do |variant|
bad_offsets.each do |offset|
input = <<-EOS
-This line is separated something that is not a horizontal rule...
+This line is separated by something that is not a horizontal rule...
#{offset}#{variant}
...from this line.
EOS
@@ -185,10 +185,10 @@
test "emphasized text using underscore characters" do
assert_xpath "//em", render_string("An _emphatic_ no")
end
test 'emphasized text with single quote using apostrophe characters' do
- rsquo = [8217].pack 'U*'
+ rsquo = decode_char 8217
assert_xpath %(//em[text()="Johnny#{rsquo}s"]), render_string(%q(It's 'Johnny's' phone), :attributes => {'compat-mode' => ''})
assert_xpath %(//p[text()="It#{rsquo}s 'Johnny#{rsquo}s' phone"]), render_string(%q(It's 'Johnny's' phone))
end
test 'emphasized text with escaped single quote using apostrophe characters' do