BigW Consortium Gitlab

registry_spec.rb 638 Bytes
Newer Older
Kamil Trzcinski committed
1 2 3 4 5 6 7 8 9 10 11 12
require 'spec_helper'

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) }

13
  it { expect(subject.repository('test')).not_to be_nil }
Kamil Trzcinski committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

  context '#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