diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2013-10-29 00:24:27 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2013-10-29 00:24:27 -0600 |
| commit | 467dda1dc107149ce7114dc1d6a0e1b2b1fff96f (patch) | |
| tree | 99ffa3a2cd13eb6caaa3a86a2d778cab63ce7935 /test/reader_test.rb | |
| parent | 735007504c0dee2a559c88d17eded715f1cc4bec (diff) | |
resolves #745 push_include and pop_include should return nil
Diffstat (limited to 'test/reader_test.rb')
| -rw-r--r-- | test/reader_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/reader_test.rb b/test/reader_test.rb index ced5de8b..33576fb6 100644 --- a/test/reader_test.rb +++ b/test/reader_test.rb @@ -405,6 +405,26 @@ preamble end end + context 'Include Stack' do + test 'PreprocessorReader#push_include method should return nil' do + doc = empty_document + reader = Asciidoctor::PreprocessorReader.new doc, '' + append_lines = %w(one two three) + result = reader.push_include append_lines, '<stdin>', '<stdin>' + assert_nil result + end + + test 'PreprocessorReader#push_include method should put lines on top of stack' do + doc = empty_document + lines = %(a b c) + reader = Asciidoctor::PreprocessorReader.new doc, lines + append_lines = %w(one two three) + reader.push_include append_lines, '<stdin>', '<stdin>' + assert_equal 1, reader.include_stack.size + assert_equal 'one', reader.read_line.rstrip + end + end + context 'Include Macro' do test 'include macro is disabled by default and becomes a link' do input = <<-EOS |
