require 'spec_helper' describe Gitlab::Highlight, lib: true do include RepoHelpers let(:project) { create(:project) } let(:commit) { project.commit(sample_commit.id) } describe '.highlight_lines' do let(:lines) do Gitlab::Highlight.highlight_lines(project.repository, commit.id, 'files/ruby/popen.rb') end it 'should properly highlight all the lines' do expect(lines[4]).to eq(%Q{ extend self\n}) expect(lines[21]).to eq(%Q{ unless File.directory?(path)\n}) expect(lines[26]).to eq(%Q{ @cmd_status = 0\n}) end end end