summaryrefslogtreecommitdiff
path: root/test/text_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2013-08-17 22:09:44 -0600
committerDan Allen <dan.j.allen@gmail.com>2013-08-21 16:17:45 -0600
commit8dc9e1c796d8466c540a484625d0919da85ebf27 (patch)
tree890b6080f7d8d3b3b8f4aab3fe1899cfdb9b464e /test/text_test.rb
parent7e86094b58e9f9e04f65cb70b05206d7668aa3b8 (diff)
resolves #575, #572 and #581 refactor reader to track include stack
- split the Reader into Reader and PreprocessorReader - maintain an internal stack of include contexts - report file names with line numbers - rework reader tests - rename several reader methods to be more intuitive - optimize operations in the readers
Diffstat (limited to 'test/text_test.rb')
-rw-r--r--test/text_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/text_test.rb b/test/text_test.rb
index d5c13dbe..22e1825e 100644
--- a/test/text_test.rb
+++ b/test/text_test.rb
@@ -27,22 +27,22 @@ context "Text" do
end
# NOTE this test ensures we have the encoding line on block templates too
- test "proper encoding to handle utf8 characters in arbitrary block" do
+ test 'proper encoding to handle utf8 characters in arbitrary block' do
input = []
input << "[verse]\n"
input.concat(File.readlines(sample_doc_path(:encoding)))
- doc = Asciidoctor::Document.new
- reader = Asciidoctor::Reader.new(input, doc, true)
+ doc = empty_document
+ reader = Asciidoctor::PreprocessorReader.new doc, input
block = Asciidoctor::Lexer.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
+ test 'proper encoding to handle utf8 characters from included file' do
input = <<-EOS
include::fixtures/encoding.asciidoc[tags=romé]
EOS
- doc = Asciidoctor::Document.new [], :safe => Asciidoctor::SafeMode::SAFE, :base_dir => File.expand_path(File.dirname(__FILE__))
- reader = Asciidoctor::Reader.new(input, doc, true)
+ doc = empty_safe_document :base_dir => File.expand_path(File.dirname(__FILE__))
+ reader = Asciidoctor::PreprocessorReader.new doc, input
block = Asciidoctor::Lexer.next_block(reader, doc)
output = block.render
assert_css '.paragraph', output, 1