Add spec tests for Repology link inline macro

This commit is contained in:
Gabriel Arazas 2023-10-29 17:37:08 +08:00
parent 60983d0d93
commit 74bb141a79
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -0,0 +1,25 @@
# frozen_string_literal: true
describe RepologyLinkInlineMacro do
it 'should link to the Repology page for beets' do
input = 'repology:beets[]'
expected = <<~RESULT
<a href="https://repology.org/project/beets">beets</a>
RESULT
actual = (Asciidoctor.convert input).tr_s '\n', '\n'
(expect actual).to include expected.chomp
end
it 'should link to the Repology page for beets with replaced caption' do
input = 'repology:beets[beets is widely available in a lot of the system distributions]'
expected = <<~RESULT
<a href="https://repology.org/project/beets">beets is widely available in a lot of the system distributions</a>
RESULT
actual = (Asciidoctor.convert input).tr_s '\n', '\n'
(expect actual).to include expected.chomp
end
end