BigW Consortium Gitlab

Commit e0ee9dac by http://jneen.net/

remove uses of the nowrap: feature

parent d625f652
...@@ -16,19 +16,19 @@ describe BlobHelper do ...@@ -16,19 +16,19 @@ describe BlobHelper do
describe '#highlight' do describe '#highlight' do
it 'should return plaintext for unknown lexer context' do it 'should return plaintext for unknown lexer context' do
result = helper.highlight(blob_name, no_context_content, nowrap: true) result = helper.highlight(blob_name, no_context_content)
expect(result).to eq('<span id="LC1" class="line">:type &quot;assem&quot;))</span>') expect(result).to eq(%<<pre class="code highlight"><code><span id="LC1" class="line">:type "assem"))</span></code></pre>>)
end end
it 'should highlight single block' do it 'should highlight single block' do
expected = %Q[<span id="LC1" class="line"><span class="p">(</span><span class="nb">make-pathname</span> <span class="ss">:defaults</span> <span class="nv">name</span></span> expected = %Q[<pre class="code highlight"><code><span id="LC1" class="line"><span class="p">(</span><span class="nb">make-pathname</span> <span class="ss">:defaults</span> <span class="nv">name</span></span>
<span id="LC2" class="line"><span class="ss">:type</span> <span class="s">&quot;assem&quot;</span><span class="p">))</span></span>] <span id="LC2" class="line"><span class="ss">:type</span> <span class="s">"assem"</span><span class="p">))</span></span></code></pre>]
expect(helper.highlight(blob_name, blob_content, nowrap: true)).to eq(expected) expect(helper.highlight(blob_name, blob_content)).to eq(expected)
end end
it 'should highlight multi-line comments' do it 'should highlight multi-line comments' do
result = helper.highlight(blob_name, multiline_content, nowrap: true) result = helper.highlight(blob_name, multiline_content)
html = Nokogiri::HTML(result) html = Nokogiri::HTML(result)
lines = html.search('.s') lines = html.search('.s')
expect(lines.count).to eq(3) expect(lines.count).to eq(3)
...@@ -41,14 +41,14 @@ describe BlobHelper do ...@@ -41,14 +41,14 @@ describe BlobHelper do
let(:blob_name) { 'test.diff' } let(:blob_name) { 'test.diff' }
let(:blob_content) { "+aaa\n+bbb\n- ccc\n ddd\n"} let(:blob_content) { "+aaa\n+bbb\n- ccc\n ddd\n"}
let(:expected) do let(:expected) do
%q(<span id="LC1" class="line"><span class="gi">+aaa</span></span> %q(<pre class="code highlight"><code><span id="LC1" class="line"><span class="gi">+aaa</span></span>
<span id="LC2" class="line"><span class="gi">+bbb</span></span> <span id="LC2" class="line"><span class="gi">+bbb</span></span>
<span id="LC3" class="line"><span class="gd">- ccc</span></span> <span id="LC3" class="line"><span class="gd">- ccc</span></span>
<span id="LC4" class="line"> ddd</span>) <span id="LC4" class="line"> ddd</span></code></pre>)
end end
it 'should highlight each line properly' do it 'should highlight each line properly' do
result = helper.highlight(blob_name, blob_content, nowrap: true) result = helper.highlight(blob_name, blob_content)
expect(result).to eq(expected) expect(result).to eq(expected)
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment