summaryrefslogtreecommitdiff
path: root/test/reader_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-02-05 23:52:07 -0700
committerDan Allen <dan.j.allen@gmail.com>2021-02-06 00:52:19 -0700
commitbc7f9f10467d28de0ffc7630bc292761aed08c91 (patch)
treeec8dc63271da5f68f01d32950b20c6328a98d00b /test/reader_test.rb
parenta1505efca095aa6a8ab33fb34a0937cd26cbe822 (diff)
verify tag filtering works if wildcards are not at head of list
Diffstat (limited to 'test/reader_test.rb')
-rw-r--r--test/reader_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/reader_test.rb b/test/reader_test.rb
index c0b8c35f..48b6f4de 100644
--- a/test/reader_test.rb
+++ b/test/reader_test.rb
@@ -1238,6 +1238,31 @@ class ReaderTest < Minitest::Test
assert_includes output, expected
end
+ test 'should recognize tag wildcard if not at head of list' do
+ input = <<~'EOS'
+ ----
+ include::fixtures/tagged-class.rb[tags=init;**;*;!bark-other]
+ ----
+ EOS
+
+ output = convert_string_to_embedded input, safe: :safe, base_dir: DIRNAME
+ # NOTE cannot use single-quoted heredoc because of https://github.com/jruby/jruby/issues/4260
+ expected = <<~EOS.chop
+ class Dog
+ def initialize breed
+ @breed = breed
+ end
+
+ def bark
+ if @breed == 'beagle'
+ 'woof woof woof woof woof'
+ end
+ end
+ end
+ EOS
+ assert_includes output, expected
+ end
+
test 'include directive selects lines for all tags when value of tags attribute is wildcard' do
input = <<~'EOS'
----