diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-18 14:11:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-18 14:11:44 +0300 |
commit | 25989ab7ef1a444ed2abd5479f176d58e1d9462a (patch) | |
tree | 271bb24f3c7178f320cb9de0be0833a285327d09 /spec/lib/gitlab/git | |
parent | 9bbb32b29703f3ce33dd35d5101145774b793a6d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/git')
-rw-r--r-- | spec/lib/gitlab/git/branch_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/git/commit_spec.rb | 9 | ||||
-rw-r--r-- | spec/lib/gitlab/git/diff_collection_spec.rb | 51 | ||||
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 3 |
4 files changed, 64 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/branch_spec.rb b/spec/lib/gitlab/git/branch_spec.rb index 0764e525ede..02ef7b92538 100644 --- a/spec/lib/gitlab/git/branch_spec.rb +++ b/spec/lib/gitlab/git/branch_spec.rb @@ -44,6 +44,7 @@ describe Gitlab::Git::Branch, :seed_helper do describe '#size' do subject { super().size } + it { is_expected.to eq(SeedRepo::Repo::BRANCHES.size) } end diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb index 3f0e6b34291..23651e3d7f2 100644 --- a/spec/lib/gitlab/git/commit_spec.rb +++ b/spec/lib/gitlab/git/commit_spec.rb @@ -174,6 +174,7 @@ describe Gitlab::Git::Commit, :seed_helper do describe '#id' do subject { super().id } + it { is_expected.to eq(SeedRepo::LastCommit::ID) } end end @@ -183,6 +184,7 @@ describe Gitlab::Git::Commit, :seed_helper do describe '#id' do subject { super().id } + it { is_expected.to eq(SeedRepo::Commit::ID) } end end @@ -192,6 +194,7 @@ describe Gitlab::Git::Commit, :seed_helper do describe '#id' do subject { super().id } + it { is_expected.to eq(SeedRepo::BigCommit::ID) } end end @@ -544,11 +547,13 @@ describe Gitlab::Git::Commit, :seed_helper do describe '#id' do subject { super().id } + it { is_expected.to eq(sample_commit_hash[:id])} end describe '#message' do subject { super().message } + it { is_expected.to eq(sample_commit_hash[:message])} end end @@ -558,16 +563,19 @@ describe Gitlab::Git::Commit, :seed_helper do describe '#additions' do subject { super().additions } + it { is_expected.to eq(11) } end describe '#deletions' do subject { super().deletions } + it { is_expected.to eq(6) } end describe '#total' do subject { super().total } + it { is_expected.to eq(17) } end end @@ -596,6 +604,7 @@ describe Gitlab::Git::Commit, :seed_helper do describe '#keys' do subject { super().keys.sort } + it { is_expected.to match(sample_commit_hash.keys.sort) } end end diff --git a/spec/lib/gitlab/git/diff_collection_spec.rb b/spec/lib/gitlab/git/diff_collection_spec.rb index ded173c49ef..ce45d6e24ba 100644 --- a/spec/lib/gitlab/git/diff_collection_spec.rb +++ b/spec/lib/gitlab/git/diff_collection_spec.rb @@ -10,6 +10,7 @@ describe Gitlab::Git::DiffCollection, :seed_helper do expanded: expanded ) end + let(:iterator) { MutatingConstantIterator.new(file_count, fake_diff(line_length, line_count)) } let(:file_count) { 0 } let(:line_length) { 1 } @@ -21,6 +22,7 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#to_a' do subject { super().to_a } + it { is_expected.to be_kind_of ::Array } end @@ -52,16 +54,19 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_falsey } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('3') } end @@ -76,6 +81,7 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#line_count' do subject { super().line_count } + it { is_expected.to eq file_count * line_count } end @@ -84,16 +90,19 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_falsey } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('3') } end @@ -108,6 +117,7 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#line_count' do subject { super().line_count } + it { is_expected.to eq file_count * line_count } end end @@ -118,21 +128,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_truthy } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('0+') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq 1000 } end @@ -143,21 +157,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_falsey } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('3') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq file_count * line_count } end @@ -174,21 +192,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_truthy } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('10+') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq 10 } end @@ -199,21 +221,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_falsey } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('11') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq file_count * line_count } end @@ -226,21 +252,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_truthy } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('3+') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq 120 } end @@ -251,21 +281,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_falsey } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('11') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq file_count * line_count } end @@ -282,21 +316,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_falsey } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('10') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq file_count * line_count } end @@ -310,21 +348,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_truthy } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('9+') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq file_count * line_count } end @@ -335,21 +377,25 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_falsey } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_falsey } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('10') } end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq file_count * line_count } end @@ -363,26 +409,31 @@ describe Gitlab::Git::DiffCollection, :seed_helper do describe '#overflow?' do subject { super().overflow? } + it { is_expected.to be_falsey } end describe '#empty?' do subject { super().empty? } + it { is_expected.to be_truthy } end describe '#size' do subject { super().size } + it { is_expected.to eq(0) } end describe '#real_size' do subject { super().real_size } + it { is_expected.to eq('0')} end describe '#line_count' do subject { super().line_count } + it { is_expected.to eq 0 } end end diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 04a648a0da0..44c41da7560 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -93,6 +93,7 @@ describe Gitlab::Git::Repository, :seed_helper do describe '#last' do subject { super().last } + it { is_expected.to eq("v1.2.1") } end it { is_expected.to include("v1.0.0") } @@ -215,11 +216,13 @@ describe Gitlab::Git::Repository, :seed_helper do describe '#first' do subject { super().first } + it { is_expected.to eq('feature') } end describe '#last' do subject { super().last } + it { is_expected.to eq('v1.2.1') } end end |