diff options
| author | Dan Allen <dallen@redhat.com> | 2013-04-21 00:10:29 -0600 |
|---|---|---|
| committer | Dan Allen <dallen@redhat.com> | 2013-04-21 00:10:29 -0600 |
| commit | e87b8adbd4e14e32bacf24bd0fbd73a798e0be94 (patch) | |
| tree | ec4b50a91ef847d76efe5ccce824e5e4db2b8f8a /test/reader_test.rb | |
| parent | 98133fbb6b4981a7b07ff71bdb7b943c1ff435b9 (diff) | |
resolves #262 warn if file in include macro doesn't exist
Diffstat (limited to 'test/reader_test.rb')
| -rw-r--r-- | test/reader_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/reader_test.rb b/test/reader_test.rb index 0d7f1418..0372096f 100644 --- a/test/reader_test.rb +++ b/test/reader_test.rb @@ -173,6 +173,19 @@ include::fixtures/include-file.asciidoc[] assert_match(/included content/, output) end + test 'missing file referenced by include macro does not crash processor' do + input = <<-EOS +include::fixtures/no-such-file.ad[] + EOS + + begin + doc = document_from_string input, :safe => Asciidoctor::SafeMode::SAFE, :attributes => {'docdir' => File.dirname(__FILE__)} + assert_equal 0, doc.blocks.size + rescue => e + flunk('include macro should not raise exception on missing file') + end + end + test 'include macro supports line selection' do input = <<-EOS include::fixtures/include-file.asciidoc[lines=1;3..4;6..-1] |
