From 4a349944620d436c4134519b75852412086d5bf0 Mon Sep 17 00:00:00 2001 From: Zoid Date: Fri, 21 Jun 2019 13:20:41 +0000 Subject: [PATCH] Bump rouge to 3.4.1 https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md#version-341-2019-06-13 --- Gemfile.lock | 2 +- spec/lib/gitlab/highlight_spec.rb | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b03bd58eacc..4881faac0e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -770,7 +770,7 @@ GEM retriable (3.1.2) rinku (2.0.0) rotp (2.1.2) - rouge (3.3.0) + rouge (3.4.1) rqrcode (0.7.0) chunky_png rqrcode-rails3 (0.1.7) diff --git a/spec/lib/gitlab/highlight_spec.rb b/spec/lib/gitlab/highlight_spec.rb index fe0e9702f8a..4676db6b8d8 100644 --- a/spec/lib/gitlab/highlight_spec.rb +++ b/spec/lib/gitlab/highlight_spec.rb @@ -18,9 +18,10 @@ describe Gitlab::Highlight do end describe '#highlight' do + let(:plain_text_file_name) { "test.txt" } + let(:plain_text_content) { "plain text contents" } let(:file_name) { 'test.lisp' } - let(:no_context_content) { ":type \"assem\"))" } - let(:content) { "(make-pathname :defaults name\n#{no_context_content}" } + let(:content) { "(make-pathname :defaults name\n:type \"assem\")" } let(:multiline_content) do %q( def test(input): @@ -32,22 +33,22 @@ describe Gitlab::Highlight do it 'highlights' do expected = %Q[(make-pathname :defaults name -:type "assem"))] +:type "assem")] expect(described_class.highlight(file_name, content)).to eq(expected) end it 'returns plain version for unknown lexer context' do - result = described_class.highlight(file_name, no_context_content) + result = described_class.highlight(plain_text_file_name, plain_text_content) - expect(result).to eq(%[:type "assem"))]) + expect(result).to eq(%[plain text contents]) end it 'returns plain version for long content' do stub_const('Gitlab::Highlight::MAXIMUM_TEXT_HIGHLIGHT_SIZE', 1) result = described_class.highlight(file_name, content) - expect(result).to eq(%[(make-pathname :defaults name\n:type "assem"))]) + expect(result).to eq(%[(make-pathname :defaults name\n:type "assem")]) end it 'highlights multi-line comments' do