Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/string_regex_marker_spec.rb')
-rw-r--r--spec/lib/gitlab/string_regex_marker_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/lib/gitlab/string_regex_marker_spec.rb b/spec/lib/gitlab/string_regex_marker_spec.rb
index 393bfea7c6b..87df8b9baab 100644
--- a/spec/lib/gitlab/string_regex_marker_spec.rb
+++ b/spec/lib/gitlab/string_regex_marker_spec.rb
@@ -5,34 +5,34 @@ require 'fast_spec_helper'
RSpec.describe Gitlab::StringRegexMarker do
describe '#mark' do
context 'with a single occurrence' do
- let(:raw) { %{"name": "AFNetworking"} }
- let(:rich) { %{<span class="key">"name"</span><span class="punctuation">: </span><span class="value">"AFNetworking"</span>}.html_safe }
+ let(:raw) { %("name": "AFNetworking") }
+ let(:rich) { %(<span class="key">"name"</span><span class="punctuation">: </span><span class="value">"AFNetworking"</span>).html_safe }
subject do
described_class.new(raw, rich).mark(/"[^"]+":\s*"(?<name>[^"]+)"/, group: :name) do |text, left:, right:, mode:|
- %{<a href="#">#{text}</a>}.html_safe
+ %(<a href="#">#{text}</a>).html_safe
end
end
it 'marks the match' do
- expect(subject).to eq(%{<span class="key">"name"</span><span class="punctuation">: </span><span class="value">"<a href="#">AFNetworking</a>"</span>})
+ expect(subject).to eq(%(<span class="key">"name"</span><span class="punctuation">: </span><span class="value">"<a href="#">AFNetworking</a>"</span>))
expect(subject).to be_html_safe
end
end
context 'with multiple occurrences' do
- let(:raw) { %{a <b> <c> d} }
- let(:rich) { %{a &lt;b&gt; &lt;c&gt; d}.html_safe }
+ let(:raw) { %(a <b> <c> d) }
+ let(:rich) { %(a &lt;b&gt; &lt;c&gt; d).html_safe }
let(:regexp) { /<[a-z]>/ }
subject do
described_class.new(raw, rich).mark(regexp) do |text, left:, right:, mode:|
- %{<strong>#{text}</strong>}.html_safe
+ %(<strong>#{text}</strong>).html_safe
end
end
it 'marks the matches' do
- expect(subject).to eq(%{a <strong>&lt;b&gt;</strong> <strong>&lt;c&gt;</strong> d})
+ expect(subject).to eq(%(a <strong>&lt;b&gt;</strong> <strong>&lt;c&gt;</strong> d))
expect(subject).to be_html_safe
end
@@ -40,7 +40,7 @@ RSpec.describe Gitlab::StringRegexMarker do
let(:regexp) { Gitlab::UntrustedRegexp.new('<[a-z]>') }
it 'marks the matches' do
- expect(subject).to eq(%{a <strong>&lt;b&gt;</strong> <strong>&lt;c&gt;</strong> d})
+ expect(subject).to eq(%(a <strong>&lt;b&gt;</strong> <strong>&lt;c&gt;</strong> d))
expect(subject).to be_html_safe
end
end