summaryrefslogtreecommitdiff
path: root/test/reader_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2018-05-07 23:56:23 -0600
committerDan Allen <dan.j.allen@gmail.com>2018-05-08 00:00:02 -0600
commit83ff5e90fa8510a8a5ebfa61c52f2a2c5670841e (patch)
tree17c5910b305e8ee42a6823fa4835f097620f01d3 /test/reader_test.rb
parent9aefdeed07b2a72b7518c80b1e67239b433f6018 (diff)
resolves #2761 substitute attribute references in attrlist of include directive
Diffstat (limited to 'test/reader_test.rb')
-rw-r--r--test/reader_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/reader_test.rb b/test/reader_test.rb
index a2aeefd0..2c392232 100644
--- a/test/reader_test.rb
+++ b/test/reader_test.rb
@@ -1260,6 +1260,19 @@ include::fixtures/basic-docinfo.xml[lines=2..3, indent=0]
assert_equal "<year>2013</year>\n<holder>Acme™, Inc.</holder>", result
end
+ test 'should substitute attribute references in attrlist' do
+ input = <<-EOS
+:name-of-tag: snippetA
+include::fixtures/include-file.asciidoc[tag={name-of-tag}]
+ EOS
+
+ output = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
+ assert_match(/snippetA content/, output)
+ refute_match(/snippetB content/, output)
+ refute_match(/non-tagged content/, output)
+ refute_match(/included content/, output)
+ end
+
test 'should fall back to built-in include directive behavior when not handled by include processor' do
input = <<-EOS
include::fixtures/include-file.asciidoc[]