2019-11-12 22:06:31 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-19 10:03:58 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe Gitlab::GitalyClient::CleanupService do
|
2018-11-19 10:03:58 -05:00
|
|
|
let(:project) { create(:project) }
|
|
|
|
let(:storage_name) { project.repository_storage }
|
|
|
|
let(:relative_path) { project.disk_path + '.git' }
|
|
|
|
let(:client) { described_class.new(project.repository) }
|
|
|
|
|
2019-03-25 10:29:51 -04:00
|
|
|
describe '#apply_bfg_object_map_stream' do
|
2019-12-08 13:07:58 -05:00
|
|
|
before do
|
|
|
|
::Gitlab::GitalyClient.clear_stubs!
|
|
|
|
end
|
|
|
|
|
2019-03-25 10:29:51 -04:00
|
|
|
it 'sends an apply_bfg_object_map_stream message' do
|
2019-12-06 19:07:51 -05:00
|
|
|
expect_next_instance_of(Gitaly::CleanupService::Stub) do |instance|
|
|
|
|
expect(instance).to receive(:apply_bfg_object_map_stream)
|
|
|
|
.with(kind_of(Enumerator), kind_of(Hash))
|
|
|
|
.and_return([])
|
|
|
|
end
|
2018-11-19 10:03:58 -05:00
|
|
|
|
2019-03-25 10:29:51 -04:00
|
|
|
client.apply_bfg_object_map_stream(StringIO.new)
|
2018-11-19 10:03:58 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|