diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-06-27 12:17:14 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-06-27 12:30:51 +0200 |
commit | 144e37c667c1681ce8c1c8292ee8f48b9eb455c5 (patch) | |
tree | a6fec0fa8a4e88a9c9eac35257bc30883aa9c10b /spec/lib/gitlab | |
parent | eacce60b1744775f4bb4c7dccfe29912d70b9984 (diff) | |
download | gitlab-ce-144e37c667c1681ce8c1c8292ee8f48b9eb455c5.tar.gz |
Remove Gitlab::Git::Repository#find_all
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/git/commit_spec.rb | 27 | ||||
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 29 |
2 files changed, 27 insertions, 29 deletions
diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb index 3e44c577643..9e44aefc2db 100644 --- a/spec/lib/gitlab/git/commit_spec.rb +++ b/spec/lib/gitlab/git/commit_spec.rb @@ -244,6 +244,33 @@ describe Gitlab::Git::Commit, seed_helper: true do end describe '.find_all' do + it 'should return a return a collection of commits' do + commits = described_class.find_all(repository) + + expect(commits).not_to be_empty + expect(commits).to all( be_a_kind_of(Gitlab::Git::Commit) ) + end + + context 'while applying a sort order based on the `order` option' do + it "allows ordering topologically (no parents shown before their children)" do + expect_any_instance_of(Rugged::Walker).to receive(:sorting).with(Rugged::SORT_TOPO) + + described_class.find_all(repository, order: :topo) + end + + it "allows ordering by date" do + expect_any_instance_of(Rugged::Walker).to receive(:sorting).with(Rugged::SORT_DATE | Rugged::SORT_TOPO) + + described_class.find_all(repository, order: :date) + end + + it "applies no sorting by default" do + expect_any_instance_of(Rugged::Walker).to receive(:sorting).with(Rugged::SORT_NONE) + + described_class.find_all(repository) + end + end + context 'max_count' do subject do commits = Gitlab::Git::Commit.find_all( diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 703b0c2c202..4894b558e03 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1101,35 +1101,6 @@ describe Gitlab::Git::Repository, seed_helper: true do end end - describe '#find_commits' do - it 'should return a return a collection of commits' do - commits = repository.find_commits - - expect(commits).not_to be_empty - expect(commits).to all( be_a_kind_of(Gitlab::Git::Commit) ) - end - - context 'while applying a sort order based on the `order` option' do - it "allows ordering topologically (no parents shown before their children)" do - expect_any_instance_of(Rugged::Walker).to receive(:sorting).with(Rugged::SORT_TOPO) - - repository.find_commits(order: :topo) - end - - it "allows ordering by date" do - expect_any_instance_of(Rugged::Walker).to receive(:sorting).with(Rugged::SORT_DATE | Rugged::SORT_TOPO) - - repository.find_commits(order: :date) - end - - it "applies no sorting by default" do - expect_any_instance_of(Rugged::Walker).to receive(:sorting).with(Rugged::SORT_NONE) - - repository.find_commits - end - end - end - describe '#branches with deleted branch' do before(:each) do ref = double() |