Welcome to mirror list, hosted at ThFree Co, Russian Federation.

registry_spec.rb « container_registry « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d6e2b17f53b0ca3bfadd023d20014ee36e970db1 (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
26
27
28
29
30
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ContainerRegistry::Registry do
  let(:path) { nil }
  let(:registry) { described_class.new('http://example.com', path: path) }

  subject { registry }

  it { is_expected.to respond_to(:client) }
  it { is_expected.to respond_to(:uri) }
  it { is_expected.to respond_to(:path) }

  it { expect(subject).not_to be_nil }

  describe '#path' do
    subject { registry.path }

    context 'path from URL' do
      it { is_expected.to eq('example.com') }
    end

    context 'custom path' do
      let(:path) { 'registry.example.com' }

      it { is_expected.to eq(path) }
    end
  end
end