summaryrefslogtreecommitdiff
path: root/test/api_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-03-13 23:46:44 -0600
committerGitHub <noreply@github.com>2019-03-13 23:46:44 -0600
commitbdb43587d39df3ffc4a2cf288f91ac92ca90d28d (patch)
tree442a6279c1b43080434919129ebd8248226d7427 /test/api_test.rb
parent59f8b3aa8ef928e94d7a515f12011a9b27ed247e (diff)
use terminology for find_by that better aligns with NodeFilter (PR #3130)
- assume that true implies "accept" - assume that false implies "skip" - prefer :reject rather than :skip - prefer :prune instead of :skip_children
Diffstat (limited to 'test/api_test.rb')
-rw-r--r--test/api_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/api_test.rb b/test/api_test.rb
index 258d6319..e00b0e56 100644
--- a/test/api_test.rb
+++ b/test/api_test.rb
@@ -712,7 +712,7 @@ context 'API' do
assert_equal 'Section', result[0].title
end
- test 'find_by should skip node and its children if block returns :skip' do
+ test 'find_by should reject node and its children if block returns :reject' do
input = <<~'EOS'
paragraph 1
@@ -730,7 +730,7 @@ context 'API' do
result = doc.find_by do |candidate|
ctx = candidate.context
if ctx == :example
- :skip
+ :reject
elsif ctx == :paragraph
true
end
@@ -741,7 +741,7 @@ context 'API' do
assert_equal :paragraph, result[1].context
end
- test 'find_by should accept node but skip its children if block returns :skip_children' do
+ test 'find_by should accept node but reject its children if block returns :prune' do
input = <<~'EOS'
====
paragraph 2
@@ -754,7 +754,7 @@ context 'API' do
doc = Asciidoctor.load input
result = doc.find_by do |candidate|
if candidate.context == :example
- :skip_children
+ :prune
end
end
refute_nil result