2019-07-25 01:21:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-05-17 10:41:47 -04:00
|
|
|
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) }
|
|
|
|
|
2016-12-15 22:24:05 -05:00
|
|
|
it { expect(subject).not_to be_nil }
|
2016-05-17 10:41:47 -04:00
|
|
|
|
|
|
|
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
|