diff options
Diffstat (limited to 'spec/lib/gitlab/diff/highlight_spec.rb')
-rw-r--r-- | spec/lib/gitlab/diff/highlight_spec.rb | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/spec/lib/gitlab/diff/highlight_spec.rb b/spec/lib/gitlab/diff/highlight_spec.rb index deab16714e0..d19bf4ac84b 100644 --- a/spec/lib/gitlab/diff/highlight_spec.rb +++ b/spec/lib/gitlab/diff/highlight_spec.rb @@ -40,38 +40,38 @@ describe Gitlab::Diff::Highlight, lib: true do end end - context "with diff lines" do - let(:subject) { Gitlab::Diff::Highlight.new(diff_file.diff_lines).highlight } + context "with diff lines" do + let(:subject) { Gitlab::Diff::Highlight.new(diff_file.diff_lines).highlight } - it 'should return Gitlab::Diff::Line elements' do - expect(subject.first).to be_an_instance_of(Gitlab::Diff::Line) - end + it 'should return Gitlab::Diff::Line elements' do + expect(subject.first).to be_an_instance_of(Gitlab::Diff::Line) + end - it 'should not modify "match" lines' do - expect(subject[0].text).to eq('@@ -6,12 +6,18 @@ module Popen') - expect(subject[22].text).to eq('@@ -19,6 +25,7 @@ module Popen') - end + it 'should not modify "match" lines' do + expect(subject[0].text).to eq('@@ -6,12 +6,18 @@ module Popen') + expect(subject[22].text).to eq('@@ -19,6 +25,7 @@ module Popen') + end - it 'marks unchanged lines' do - code = %Q{ def popen(cmd, path=nil)} + it 'marks unchanged lines' do + code = %Q{ def popen(cmd, path=nil)} - expect(subject[2].text).to eq(code) - expect(subject[2].text).not_to be_html_safe - end + expect(subject[2].text).to eq(code) + expect(subject[2].text).not_to be_html_safe + end - it 'marks removed lines' do - code = %Q{- raise "System commands must be given as an array of strings"} + it 'marks removed lines' do + code = %Q{- raise "System commands must be given as an array of strings"} - expect(subject[4].text).to eq(code) - expect(subject[4].text).not_to be_html_safe - end + expect(subject[4].text).to eq(code) + expect(subject[4].text).not_to be_html_safe + end - it 'marks added lines' do - code = %Q{+ raise <span class='idiff left right'>RuntimeError, </span>"System commands must be given as an array of strings"} + it 'marks added lines' do + code = %Q{+ raise <span class='idiff left right'>RuntimeError, </span>"System commands must be given as an array of strings"} - expect(subject[5].text).to eq(code) - expect(subject[5].text).to be_html_safe - end + expect(subject[5].text).to eq(code) + expect(subject[5].text).to be_html_safe end + end end end |