summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2024-05-12 12:51:57 -0600
committerDan Allen <dan.j.allen@gmail.com>2024-05-12 12:51:57 -0600
commit45e8c5421ed46a175f20cbd58d567d8292175f35 (patch)
tree9b2a2698a2a60e3bd73f9347ea5f806e0085a507
parentd9e6cad66e260efeb46a3e9c962cb86b6f705803 (diff)
split tests for bare URI scheme to make intention more clear
-rw-r--r--test/links_test.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/test/links_test.rb b/test/links_test.rb
index 8d8299dc..1c8fd4e4 100644
--- a/test/links_test.rb
+++ b/test/links_test.rb
@@ -193,16 +193,31 @@ context 'Links' do
end
test 'URI scheme with trailing characters should not be converted to a link' do
- input_sources = %w(
- (https://)
+ comma = ','
+ input_sources = %W(
+ http://;
+ file://:
+ irc://#{comma}
+ )
+ expected_outputs = %W(
http://;
file://:
+ irc://#{comma}
+ )
+ input_sources.each_with_index do |input_source, i|
+ expected_output = expected_outputs[i]
+ actual = block_from_string input_source
+ assert_equal expected_output, actual.content
+ end
+ end
+
+ test 'bare URI scheme enclosed in brackets should not be converted to link' do
+ input_sources = %w(
+ (https://)
<ftp://>
)
expected_outputs = %w(
(https://)
- http://;
- file://:
&lt;ftp://&gt;
)
input_sources.each_with_index do |input_source, i|