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
Kazuhiko Shiozaki
gitlab-ce
Commits
be41d0e1
Commit
be41d0e1
authored
11 years ago
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gitlab::Git::Diff specs
parent
14798b8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
spec/lib/gitlab/git/diff_spec.rb
spec/lib/gitlab/git/diff_spec.rb
+34
-0
No files found.
spec/lib/gitlab/git/diff_spec.rb
0 → 100644
View file @
be41d0e1
require
"spec_helper"
describe
Gitlab
::
Git
::
Diff
do
before
do
@raw_diff_hash
=
{
diff:
'Hello world'
,
new_path:
'temp.rb'
,
old_path:
'test.rb'
,
a_mode:
'100644'
,
b_mode:
'100644'
,
new_file:
false
,
renamed_file:
true
,
deleted_file:
false
,
}
@grit_diff
=
double
(
'Grit::Diff'
,
@raw_diff_hash
)
end
context
'init from grit'
do
before
do
@diff
=
Gitlab
::
Git
::
Diff
.
new
(
@raw_diff_hash
)
end
it
{
@diff
.
to_hash
.
should
==
@raw_diff_hash
}
end
context
'init from hash'
do
before
do
@diff
=
Gitlab
::
Git
::
Diff
.
new
(
@grit_diff
)
end
it
{
@diff
.
to_hash
.
should
==
@raw_diff_hash
}
end
end
This diff is collapsed.
Click to expand it.
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