Skip to content

Commit 0494067

Browse files
committed
Test TIDYLINK regular expression
1 parent 501482b commit 0494067

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

test/test_rdoc_markup_formatter.rb

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ def special_names
7070
def test_add_special_RDOCLINK
7171
@to.add_special_RDOCLINK
7272

73+
assert_includes special_names, 'RDOCLINK'
74+
7375
def @to.handle_special_RDOCLINK special
7476
"<#{special.text}>"
7577
end
7678

77-
assert_includes special_names, 'RDOCLINK'
78-
7979
document = doc(para('{foo}[rdoc-label:bar].'))
8080

8181
formatted = document.accept @to
@@ -87,6 +87,22 @@ def test_add_special_TIDYLINK
8787
@to.add_special_TIDYLINK
8888

8989
assert_includes special_names, 'TIDYLINK'
90+
91+
def @to.handle_special_TIDYLINK special
92+
"<#{special.text}>"
93+
end
94+
95+
document = doc(para('foo[rdoc-label:bar].'))
96+
97+
formatted = document.accept @to
98+
99+
assert_equal '<foo[rdoc-label:bar]>.', formatted
100+
101+
document = doc(para('{foo}[rdoc-label:bar].'))
102+
103+
formatted = document.accept @to
104+
105+
assert_equal '<{foo}[rdoc-label:bar]>.', formatted
90106
end
91107

92108
def test_parse_url

0 commit comments

Comments
 (0)