summaryrefslogtreecommitdiff
path: root/test/reader_test.rb
diff options
context:
space:
mode:
authorDan Allen <dallen@redhat.com>2013-04-18 16:00:35 -0600
committerDan Allen <dallen@redhat.com>2013-04-18 16:00:35 -0600
commitc7bb02c481f3ebe9cd3e71592b7260ea0e5c8682 (patch)
tree17c3b6df2b292a5374af19ed1b2548769385deda /test/reader_test.rb
parente74f0a7967c3936001a565247a9fc9b86372c74a (diff)
resolves #241 negative case for inline ifndef should only affect current line
Diffstat (limited to 'test/reader_test.rb')
-rw-r--r--test/reader_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/reader_test.rb b/test/reader_test.rb
index bc7832a8..0d7f1418 100644
--- a/test/reader_test.rb
+++ b/test/reader_test.rb
@@ -387,6 +387,22 @@ There was much rejoicing.
assert_equal "On our quest we go...\nThere is a holy grail!\nThere was much rejoicing.", lines.join.strip
end
+ test 'ifndef with defined attribute does not include text in brackets' do
+ input = <<-EOS
+On our quest we go...
+ifndef::hardships[There is a holy grail!]
+There was no rejoicing.
+ EOS
+
+ doc = Asciidoctor::Document.new [], :attributes => {'hardships' => ''}
+ reader = Asciidoctor::Reader.new(input.lines.entries, doc, true)
+ lines = []
+ while reader.has_more_lines?
+ lines << reader.get_line
+ end
+ assert_equal "On our quest we go...\nThere was no rejoicing.", lines.join.strip
+ end
+
test 'include with non-matching nested exclude' do
input = <<-EOS
ifdef::grail[]