summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-07-24 23:57:31 -0600
committerGitHub <noreply@github.com>2022-07-24 23:57:31 -0600
commit5c2a8cc39f6e27aa38fef374f8e1e5e11ce46383 (patch)
tree703f35847cb19dc42220ff685177976b484d7768 /test
parent2d9671f592a11be193100b31bb24a1691c31abf8 (diff)
resolves #4315 warn if include target is remote and allow-uri-read attribute is not set (PR #4316)
Diffstat (limited to 'test')
-rw-r--r--test/reader_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/reader_test.rb b/test/reader_test.rb
index 849a1332..9f9153fe 100644
--- a/test/reader_test.rb
+++ b/test/reader_test.rb
@@ -679,7 +679,17 @@ class ReaderTest < Minitest::Test
doc = Asciidoctor::Document.new input, safe: :safe
reader = doc.reader
assert_equal 'link:http://example.org/team.adoc[]', reader.read_line
- assert_empty logger
+ assert_message logger, :WARN, '<stdin>: line 1: cannot include contents of URI: http://example.org/team.adoc (allow-uri-read attribute not enabled)', Hash
+ end
+ end
+
+ test 'include directive with remote target is converted to a link when safe mode is secure' do
+ using_memory_logger do |logger|
+ input = 'include::http://example.org/team.adoc[]'
+ doc = Asciidoctor::Document.new input, safe: :secure
+ reader = doc.reader
+ assert_equal 'link:http://example.org/team.adoc[]', reader.read_line
+ assert_empty logger.messages
end
end