summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/lib/gitlab/repo_type_shared_examples.rb
blob: 025f0d5c7ead5d0f2e894acf154e6cca1a0c2f12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

RSpec.shared_examples 'a repo type' do
  describe '#identifier_for_container' do
    subject { described_class.identifier_for_container(expected_container) }

    it { is_expected.to eq(expected_identifier) }
  end

  describe '#path_suffix' do
    subject { described_class.path_suffix }

    it { is_expected.to eq(expected_suffix) }
  end

  describe '#repository_for' do
    it 'finds the repository for the repo type' do
      expect(described_class.repository_for(expected_container)).to eq(expected_repository)
    end

    it 'returns nil when container is nil' do
      expect(described_class.repository_for(nil)).to eq(nil)
    end
  end
end