summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb')
-rw-r--r--spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb b/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb
new file mode 100644
index 00000000000..d6e8b8ac4b2
--- /dev/null
+++ b/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe Gitlab::Diff::InlineDiffMarkdownMarker, lib: true do
+ describe '#mark' do
+ let(:raw) { "abc 'def'" }
+ let(:inline_diffs) { [2..5] }
+ let(:subject) { described_class.new(raw).mark(inline_diffs, mode: :deletion) }
+
+ it 'marks the range' do
+ expect(subject).to eq("ab{-c 'd-}ef'")
+ expect(subject).to be_html_safe
+ end
+ end
+end