diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 15:08:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 15:08:18 +0300 |
commit | 684d65316ac77c62f47d68b9926eea8af30db227 (patch) | |
tree | d1f4c4eec399d7772ab4ad6294f98e7505c1cee5 /spec/lib/gitlab/git/blob_spec.rb | |
parent | ade18c9d68d5a2e6c6e28ef7e9d3add3b3491ace (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/git/blob_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/blob_spec.rb | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb index 9c2f0e910b1..f25383ef416 100644 --- a/spec/lib/gitlab/git/blob_spec.rb +++ b/spec/lib/gitlab/git/blob_spec.rb @@ -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 } - # 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") } + 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 + 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 |