summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2018-05-09 23:56:29 -0600
committerGitHub <noreply@github.com>2018-05-09 23:56:29 -0600
commitef7a1a7de4d45985ee16b861dc0508ce481aa5b7 (patch)
tree7fcb698de8b69c72bbe5c30f9ad32d7c0b6282fd /test
parent358f94434bbc588531c9f3b2396a16a9088af50d (diff)
parent981dabee666d2cec20e0a4fd19ad30933aa2f45b (diff)
merge PR #2765
resolves #2761 substitute attribute references in attrlist of include directive
Diffstat (limited to 'test')
-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[]