Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
e0ee9dac
Commit
e0ee9dac
authored
Jun 21, 2016
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove uses of the nowrap: feature
parent
d625f652
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
spec/helpers/blob_helper_spec.rb
spec/helpers/blob_helper_spec.rb
+9
-9
No files found.
spec/helpers/blob_helper_spec.rb
View file @
e0ee9dac
...
@@ -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 "assem"))</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">
"assem"</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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment