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
88a842e2
Commit
88a842e2
authored
Apr 02, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Squash examples in spec/lib/gitlab/git/blob_spec.rb
parent
fcf2ee20
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
+24
-19
.rubocop.yml
.rubocop.yml
+0
-1
spec/lib/gitlab/git/blob_spec.rb
spec/lib/gitlab/git/blob_spec.rb
+24
-18
No files found.
.rubocop.yml
View file @
88a842e2
...
...
@@ -404,7 +404,6 @@ RSpec/RepeatedExample:
-
'
spec/lib/banzai/filter/autolink_filter_spec.rb'
-
'
spec/lib/gitlab/closing_issue_extractor_spec.rb'
-
'
spec/lib/gitlab/danger/changelog_spec.rb'
-
'
spec/lib/gitlab/git/blob_spec.rb'
-
'
spec/lib/gitlab/import_export/project/relation_factory_spec.rb'
-
'
spec/models/ability_spec.rb'
-
'
spec/models/ci/build_spec.rb'
...
...
spec/lib/gitlab/git/blob_spec.rb
View file @
88a842e2
...
...
@@ -409,37 +409,43 @@ describe Gitlab::Git::Blob, :seed_helper do
end
end
describe
'encoding'
do
describe
'encoding'
,
:aggregate_failures
do
context
'file with russian text'
do
let
(
:blob
)
{
Gitlab
::
Git
::
Blob
.
find
(
repository
,
SeedRepo
::
Commit
::
ID
,
"encoding/russian.rb"
)
}
it
{
expect
(
blob
.
name
).
to
eq
(
"russian.rb"
)
}
it
{
expect
(
blob
.
data
.
lines
.
first
).
to
eq
(
"Хороший файл"
)
}
it
{
expect
(
blob
.
size
).
to
eq
(
23
)
}
it
{
expect
(
blob
.
truncated?
).
to
be_falsey
}
it
'has the correct blob attributes'
do
expect
(
blob
.
name
).
to
eq
(
"russian.rb"
)
expect
(
blob
.
data
.
lines
.
first
).
to
eq
(
"Хороший файл"
)
expect
(
blob
.
size
).
to
eq
(
23
)
expect
(
blob
.
truncated?
).
to
be_falsey
# Run it twice since data is encoded after the first run
it
{
expect
(
blob
.
truncated?
).
to
be_falsey
}
it
{
expect
(
blob
.
mode
).
to
eq
(
"100755"
)
}
expect
(
blob
.
truncated?
).
to
be_falsey
expect
(
blob
.
mode
).
to
eq
(
"100755"
)
end
end
context
'file with Japanese text'
do
let
(
:blob
)
{
Gitlab
::
Git
::
Blob
.
find
(
repository
,
SeedRepo
::
Commit
::
ID
,
"encoding/テスト.txt"
)
}
it
{
expect
(
blob
.
name
).
to
eq
(
"テスト.txt"
)
}
it
{
expect
(
blob
.
data
).
to
include
(
"これはテスト"
)
}
it
{
expect
(
blob
.
size
).
to
eq
(
340
)
}
it
{
expect
(
blob
.
mode
).
to
eq
(
"100755"
)
}
it
{
expect
(
blob
.
truncated?
).
to
be_falsey
}
it
'has the correct blob attributes'
do
expect
(
blob
.
name
).
to
eq
(
"テスト.txt"
)
expect
(
blob
.
data
).
to
include
(
"これはテスト"
)
expect
(
blob
.
size
).
to
eq
(
340
)
expect
(
blob
.
mode
).
to
eq
(
"100755"
)
expect
(
blob
.
truncated?
).
to
be_falsey
end
end
context
'file with ISO-8859 text'
do
let
(
:blob
)
{
Gitlab
::
Git
::
Blob
.
find
(
repository
,
SeedRepo
::
LastCommit
::
ID
,
"encoding/iso8859.txt"
)
}
it
{
expect
(
blob
.
name
).
to
eq
(
"iso8859.txt"
)
}
it
{
expect
(
blob
.
loaded_size
).
to
eq
(
4
)
}
it
{
expect
(
blob
.
size
).
to
eq
(
4
)
}
it
{
expect
(
blob
.
mode
).
to
eq
(
"100644"
)
}
it
{
expect
(
blob
.
truncated?
).
to
be_falsey
}
it
'has the correct blob attributes'
do
expect
(
blob
.
name
).
to
eq
(
"iso8859.txt"
)
expect
(
blob
.
loaded_size
).
to
eq
(
4
)
expect
(
blob
.
size
).
to
eq
(
4
)
expect
(
blob
.
mode
).
to
eq
(
"100644"
)
expect
(
blob
.
truncated?
).
to
be_falsey
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