diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-10 17:37:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-10 17:37:58 +0000 |
commit | d244360d8b38218bd3e71c0203e9f2af41498daa (patch) | |
tree | 4dd99c19f76256866770d4035b606e7d9dfbdc6f /spec/lib/gitlab/regex_spec.rb | |
parent | f030ca96950296390a162ebc7b59914282bdb605 (diff) | |
download | gitlab-ce-d244360d8b38218bd3e71c0203e9f2af41498daa.tar.gz |
Add latest changes from gitlab-org/gitlab@15-9-stable-ee
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 |