summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2014-07-17 04:09:19 -0600
committerDan Allen <dan.j.allen@gmail.com>2014-07-17 04:09:19 -0600
commit2ab989b15d412f64219d940870837910ef866663 (patch)
tree698d826b58caf5670ce6e687bb4f52616b9f1de3 /test
parentf1a5082dd334aa0916f868679630421b6be625e4 (diff)
parent1f31f08133334b43988398f37924a69e0d452d9b (diff)
Merge pull request #1028 from mojavelinux/issue-1027
resolves #1027 don't include lines that contain a tag directive
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/include-file.asciidoc2
-rw-r--r--test/reader_test.rb16
2 files changed, 18 insertions, 0 deletions
diff --git a/test/fixtures/include-file.asciidoc b/test/fixtures/include-file.asciidoc
index 4f1fc0e6..995dde83 100644
--- a/test/fixtures/include-file.asciidoc
+++ b/test/fixtures/include-file.asciidoc
@@ -7,6 +7,7 @@ sixth line of included content
seventh line of included content
eighth line of included content
+// tag::snippet[]
// tag::snippetA[]
snippetA content
// end::snippetA[]
@@ -16,6 +17,7 @@ non-tagged content
// tag::snippetB[]
snippetB content
// end::snippetB[]
+// end::snippet[]
more non-tagged content
diff --git a/test/reader_test.rb b/test/reader_test.rb
index 3fbbd193..b8c99f81 100644
--- a/test/reader_test.rb
+++ b/test/reader_test.rb
@@ -708,6 +708,22 @@ include::fixtures/include-file.asciidoc[tags=snippetA;snippetB]
refute_match(/included content/, output)
end
+ test 'include directive does not select tagged lines inside tagged selection' do
+ input = <<-EOS
+++++
+include::fixtures/include-file.asciidoc[tags=snippet]
+++++
+ EOS
+
+ output = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
+ expect = %(snippetA content
+
+non-tagged content
+
+snippetB content)
+ assert_equal expect, output
+ end
+
test 'should warn if tag is not found in include file' do
input = <<-EOS
include::fixtures/include-file.asciidoc[tag=snippetZ]