Sha256: fd0023f1800b32c9b7bd5488c29697c1b5a0722f9916d35570697891c9add240
Contents?: true
Size: 1.78 KB
Versions: 2
Compression:
Stored size: 1.78 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) } 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') } 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') } 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kuby-core-0.11.13 | spec/docker/metadata_spec.rb |
kuby-core-0.11.12 | spec/docker/metadata_spec.rb |