From 74bb141a79ee7d24205a2b2d37f537821d2570b0 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 29 Oct 2023 17:37:08 +0800 Subject: [PATCH] Add spec tests for Repology link inline macro --- spec/repology_link_inline_macro_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/repology_link_inline_macro_spec.rb diff --git a/spec/repology_link_inline_macro_spec.rb b/spec/repology_link_inline_macro_spec.rb new file mode 100644 index 0000000..1ada452 --- /dev/null +++ b/spec/repology_link_inline_macro_spec.rb @@ -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 + beets + 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 + beets is widely available in a lot of the system distributions + RESULT + + actual = (Asciidoctor.convert input).tr_s '\n', '\n' + (expect actual).to include expected.chomp + end +end