diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2018-04-28 18:25:12 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2018-04-28 18:26:08 -0600 |
| commit | 6d9bd8bb83864149d756e2c73c23325859caf449 (patch) | |
| tree | bdc01eac5e14845beb470276dce459df833493f6 /test/reader_test.rb | |
| parent | 639d7349c0f1d7c158cfa074fe8c35012a561f8a (diff) | |
use cursor from source file as context for messages about include tags
Diffstat (limited to 'test/reader_test.rb')
| -rw-r--r-- | test/reader_test.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/reader_test.rb b/test/reader_test.rb index 62edd785..b9a89648 100644 --- a/test/reader_test.rb +++ b/test/reader_test.rb @@ -1195,10 +1195,26 @@ include::fixtures/mismatched-end-tag.adoc[tags=a;b] ++++ EOS + inc_path = File.join DIRNAME, 'fixtures/mismatched-end-tag.adoc' using_memory_logger do |logger| result = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME assert_equal %(a\nb), result - assert_message logger, :WARN, 'fixtures/mismatched-end-tag.adoc: line 5: mismatched end tag in include: expected b, found a', Hash + assert_message logger, :WARN, %(<stdin>: line 2: mismatched end tag (expected 'b' but found 'a') at line 5 of include file: #{inc_path}), Hash + end + end + + test 'should warn if unexpected end tag is found in included file' do + input = <<-EOS +++++ +include::fixtures/unexpected-end-tag.adoc[tags=a] +++++ + EOS + + inc_path = File.join DIRNAME, 'fixtures/unexpected-end-tag.adoc' + using_memory_logger do |logger| + result = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME + assert_equal 'a', result + assert_message logger, :WARN, %(<stdin>: line 2: unexpected end tag 'a' at line 4 of include file: #{inc_path}), Hash end end |
