diff options
Diffstat (limited to 'spec/lib/gitlab/regex_spec.rb')
-rw-r--r-- | spec/lib/gitlab/regex_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index caca33704dd..31de4068bc5 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -1142,7 +1142,7 @@ RSpec.describe Gitlab::Regex, feature_category: :tooling do context 'HTML comment lines' do subject { described_class::MARKDOWN_HTML_COMMENT_LINE_REGEX } - let(:expected) { %(<!-- an HTML comment -->) } + let(:expected) { [['<!-- an HTML comment -->'], ['<!-- another HTML comment -->']] } let(:markdown) do <<~MARKDOWN Regular text @@ -1150,13 +1150,15 @@ RSpec.describe Gitlab::Regex, feature_category: :tooling do <!-- an HTML comment --> more text + + <!-- another HTML comment --> MARKDOWN end it { is_expected.to match(%(<!-- single line comment -->)) } it { is_expected.not_to match(%(<!--\nblock comment\n-->)) } it { is_expected.not_to match(%(must start in first column <!-- comment -->)) } - it { expect(subject.match(markdown)[:html_comment_line]).to eq expected } + it { expect(markdown.scan(subject)).to eq expected } end context 'HTML comment blocks' do |