"
else
- wrap_values(val, "class=\"#{tok.shortname}\"")
+ "#{val}"
end
end
end
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb
index 76009c3609..b8bba36439 100644
--- a/spec/helpers/blob_helper_spec.rb
+++ b/spec/helpers/blob_helper_spec.rb
@@ -47,5 +47,21 @@ describe BlobHelper do
expect(lines[1].text).to eq(' This is line 2.')
expect(lines[2].text).to eq(' """')
end
+
+ context 'diff highlighting' do
+ let(:blob_name) { 'test.diff' }
+ let(:blob_content) { "+aaa\n+bbb\n- ccc\n ddd\n"}
+ let(:expected) do
+ %q(+aaa
++bbb
+- ccc
+ ddd)
+ end
+
+ it 'should highlight each line properly' do
+ result = highlight(blob_name, blob_content, nowrap: true, continue: false)
+ expect(result).to eq(expected)
+ end
+ end
end
end
diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb
index b392371deb..da58ab9846 100644
--- a/spec/helpers/events_helper_spec.rb
+++ b/spec/helpers/events_helper_spec.rb
@@ -58,7 +58,7 @@ describe EventsHelper do
expected = '' \
"def test\n" \
" \'hello world\'\n" \
- "end\n" \
+ "end" \
''
expect(event_note(input)).to eq(expected)
end