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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
cd9bea77
Commit
cd9bea77
authored
Jun 16, 2016
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the spec, using project.change_head
parent
8d24ca15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
spec/lib/gitlab/highlight_spec.rb
spec/lib/gitlab/highlight_spec.rb
+9
-3
spec/support/test_env.rb
spec/support/test_env.rb
+1
-0
No files found.
spec/lib/gitlab/highlight_spec.rb
View file @
cd9bea77
...
...
@@ -4,6 +4,7 @@ describe Gitlab::Highlight, lib: true do
include
RepoHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:commit
)
{
project
.
commit
(
sample_commit
.
id
)
}
describe
'.highlight_lines'
do
...
...
@@ -19,13 +20,18 @@ describe Gitlab::Highlight, lib: true do
end
describe
'custom highlighting from .gitattributes'
do
let
(
:blob
)
{
project
.
blob_at_branch
(
'master'
,
'custom-highlighting/test.gitlab-custom'
)
}
let
(
:branch
)
{
'gitattributes'
}
let
(
:path
)
{
'custom-highlighting/test.gitlab-custom'
}
let
(
:blob
)
{
repository
.
blob_at_branch
(
branch
,
path
)
}
let
(
:highlighter
)
{
Gitlab
::
Highlight
.
new
(
blob
.
path
,
blob
.
contents
,
repository:
project
.
repository
)
Gitlab
::
Highlight
.
new
(
blob
.
path
,
blob
.
data
,
repository:
repository
)
}
before
{
project
.
change_head
(
'gitattributes'
)
}
it
'highlights as ruby'
do
expect
(
highlighter
.
lexer
).
to
be
_an_instance_of
Rouge
::
Lexers
::
Ruby
expect
(
highlighter
.
lexer
).
to
be
Rouge
::
Lexers
::
Ruby
end
end
end
spec/support/test_env.rb
View file @
cd9bea77
...
...
@@ -17,6 +17,7 @@ module TestEnv
"'test'"
=>
'e56497b'
,
'orphaned-branch'
=>
'45127a9'
,
'binary-encoding'
=>
'7b1cf43'
,
'gitattributes'
=>
'281d3a76'
}
# gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily
...
...
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