Sha256: 3c9e5c4777c5fa994c5beaac1f2f0baee2dcb726c1f1345085af898e04ba5c25
Contents?: true
Size: 1.79 KB
Versions: 3
Compression:
Stored size: 1.79 KB
Contents
# typed: false require 'spec_helper' require 'timecop' describe Kuby::Docker::Metadata do let(:metadata) { definition.environment.docker.metadata } describe '#image_url' do subject { metadata.image_url } it { is_expected.to eq(docker_image_url) } context 'when no image URL is configured' do let(:docker_image_url) { nil } it { is_expected.to eq(definition.app_name) } end end describe '#image_host' do subject { metadata.image_host } it { is_expected.to eq("#{Kuby::Docker::DockerURI::DEFAULT_REGISTRY_HOST}:443") } context 'when the image URL contains an explicit host' do let(:docker_image_url) { 'registry.foo.com/foo/testapp' } it { is_expected.to eq('registry.foo.com:443') } end context 'when the image URL contains an explicit host' do let(:docker_image_url) { 'http://registry.foo.com/foo/testapp' } it { is_expected.to eq('registry.foo.com:443') } end end describe '#image_repo' do subject { metadata.image_repo } it { is_expected.to eq('foo/testapp') } context 'when the image URL contains an explicit host' do let(:docker_image_url) { 'registry.foo.com/foo/testapp' } it { is_expected.to eq('foo/testapp') } end end describe '#tags' do subject { metadata.tags } it 'specifies the current timestamp tag and the default tag' do Timecop.freeze do expect(subject).to eq([ Time.now.strftime('%Y%m%d%H%M%S'), Kuby::Docker::Metadata::LATEST_TAG ]) end end end describe '#distro' do subject { metadata.distro } it { is_expected.to eq(Kuby::Docker::Metadata::DEFAULT_DISTRO) } context 'with a distro set manually' do before { metadata.distro = :alpine } it { is_expected.to eq(:alpine) } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
kuby-core-0.11.16 | spec/docker/metadata_spec.rb |
kuby-core-0.11.15 | spec/docker/metadata_spec.rb |
kuby-core-0.11.14 | spec/docker/metadata_spec.rb |