diff options
Diffstat (limited to 'spec/lib/gitlab/git/compare_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/compare_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/lib/gitlab/git/compare_spec.rb b/spec/lib/gitlab/git/compare_spec.rb index e8c683cf8aa..81b5aa94656 100644 --- a/spec/lib/gitlab/git/compare_spec.rb +++ b/spec/lib/gitlab/git/compare_spec.rb @@ -5,8 +5,8 @@ require "spec_helper" RSpec.describe Gitlab::Git::Compare do let_it_be(:repository) { create(:project, :repository).repository.raw } - let(:compare) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, SeedRepo::Commit::ID, straight: false) } - let(:compare_straight) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, SeedRepo::Commit::ID, straight: true) } + let(:compare) { described_class.new(repository, SeedRepo::BigCommit::ID, SeedRepo::Commit::ID, straight: false) } + let(:compare_straight) { described_class.new(repository, SeedRepo::BigCommit::ID, SeedRepo::Commit::ID, straight: true) } describe '#commits' do subject do @@ -21,25 +21,25 @@ RSpec.describe Gitlab::Git::Compare do it { is_expected.not_to include(SeedRepo::BigCommit::PARENT_ID) } context 'non-existing base ref' do - let(:compare) { Gitlab::Git::Compare.new(repository, 'no-such-branch', SeedRepo::Commit::ID) } + let(:compare) { described_class.new(repository, 'no-such-branch', SeedRepo::Commit::ID) } it { is_expected.to be_empty } end context 'non-existing head ref' do - let(:compare) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, '1234567890') } + let(:compare) { described_class.new(repository, SeedRepo::BigCommit::ID, '1234567890') } it { is_expected.to be_empty } end context 'base ref is equal to head ref' do - let(:compare) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, SeedRepo::BigCommit::ID) } + let(:compare) { described_class.new(repository, SeedRepo::BigCommit::ID, SeedRepo::BigCommit::ID) } it { is_expected.to be_empty } end context 'providing nil as base ref or head ref' do - let(:compare) { Gitlab::Git::Compare.new(repository, nil, nil) } + let(:compare) { described_class.new(repository, nil, nil) } it { is_expected.to be_empty } end @@ -58,13 +58,13 @@ RSpec.describe Gitlab::Git::Compare do it { is_expected.not_to include('LICENSE') } context 'non-existing base ref' do - let(:compare) { Gitlab::Git::Compare.new(repository, 'no-such-branch', SeedRepo::Commit::ID) } + let(:compare) { described_class.new(repository, 'no-such-branch', SeedRepo::Commit::ID) } it { is_expected.to be_empty } end context 'non-existing head ref' do - let(:compare) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, '1234567890') } + let(:compare) { described_class.new(repository, SeedRepo::BigCommit::ID, '1234567890') } it { is_expected.to be_empty } end @@ -78,7 +78,7 @@ RSpec.describe Gitlab::Git::Compare do it { is_expected.to eq(false) } context 'base ref is equal to head ref' do - let(:compare) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, SeedRepo::BigCommit::ID) } + let(:compare) { described_class.new(repository, SeedRepo::BigCommit::ID, SeedRepo::BigCommit::ID) } it { is_expected.to eq(true) } end |