diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-07 03:07:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-07 03:07:51 +0300 |
commit | 4e375367b78bb44bd00957522cd9fc3e6d403fef (patch) | |
tree | 059b1ce541e4128bf03683407d7b5bbbc2094ed5 /spec/lib/gitlab/git | |
parent | 99ddca0d88f1e4e49d61b1aa9d41b5785528d1dc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/git')
-rw-r--r-- | spec/lib/gitlab/git/blob_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/git/commit_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/gitlab/git/tree_spec.rb | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb index 15d03a481d5..a659af3d22e 100644 --- a/spec/lib/gitlab/git/blob_spec.rb +++ b/spec/lib/gitlab/git/blob_spec.rb @@ -134,7 +134,9 @@ describe Gitlab::Git::Blob, :seed_helper do describe '.find with Rugged enabled', :enable_rugged do it 'calls out to the Rugged implementation' do - allow_any_instance_of(Rugged).to receive(:rev_parse).with(SeedRepo::Commit::ID).and_call_original + allow_next_instance_of(Rugged) do |instance| + allow(instance).to receive(:rev_parse).with(SeedRepo::Commit::ID).and_call_original + end described_class.find(repository, SeedRepo::Commit::ID, 'files/images/6049019_460s.jpg') end diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb index 0ab3e513e24..63f443e19d2 100644 --- a/spec/lib/gitlab/git/commit_spec.rb +++ b/spec/lib/gitlab/git/commit_spec.rb @@ -176,7 +176,9 @@ describe Gitlab::Git::Commit, :seed_helper do describe '.find with Rugged enabled', :enable_rugged do it 'calls out to the Rugged implementation' do - allow_any_instance_of(Rugged).to receive(:rev_parse).with(SeedRepo::Commit::ID).and_call_original + allow_next_instance_of(Rugged) do |instance| + allow(instance).to receive(:rev_parse).with(SeedRepo::Commit::ID).and_call_original + end described_class.find(repository, SeedRepo::Commit::ID) end @@ -438,7 +440,9 @@ describe Gitlab::Git::Commit, :seed_helper do it_should_behave_like '.batch_by_oid' it 'calls out to the Rugged implementation' do - allow_any_instance_of(Rugged).to receive(:rev_parse).with(SeedRepo::Commit::ID).and_call_original + allow_next_instance_of(Rugged) do |instance| + allow(instance).to receive(:rev_parse).with(SeedRepo::Commit::ID).and_call_original + end described_class.batch_by_oid(repository, [SeedRepo::Commit::ID]) end diff --git a/spec/lib/gitlab/git/tree_spec.rb b/spec/lib/gitlab/git/tree_spec.rb index 98bb4ffd0bd..d82acad866c 100644 --- a/spec/lib/gitlab/git/tree_spec.rb +++ b/spec/lib/gitlab/git/tree_spec.rb @@ -145,7 +145,9 @@ describe Gitlab::Git::Tree, :seed_helper do describe '.where with Rugged enabled', :enable_rugged do it 'calls out to the Rugged implementation' do - allow_any_instance_of(Rugged).to receive(:lookup).with(SeedRepo::Commit::ID) + allow_next_instance_of(Rugged) do |instance| + allow(instance).to receive(:lookup).with(SeedRepo::Commit::ID) + end described_class.where(repository, SeedRepo::Commit::ID, 'files', false) end |