Fix registry for projects with uppercases in path
This commit is contained in:
parent
37ab389139
commit
259108ada3
2 changed files with 20 additions and 4 deletions
|
@ -15,7 +15,7 @@ module ContainerRegistry
|
|||
LEVELS_SUPPORTED = 3
|
||||
|
||||
def initialize(path)
|
||||
@path = path
|
||||
@path = path.downcase
|
||||
end
|
||||
|
||||
def valid?
|
||||
|
|
|
@ -33,10 +33,20 @@ describe ContainerRegistry::Path do
|
|||
end
|
||||
|
||||
describe '#to_s' do
|
||||
let(:path) { 'some/image' }
|
||||
context 'when path does not have uppercase characters' do
|
||||
let(:path) { 'some/image' }
|
||||
|
||||
it 'return a string with a repository path' do
|
||||
expect(subject.to_s).to eq path
|
||||
it 'return a string with a repository path' do
|
||||
expect(subject.to_s).to eq 'some/image'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when path has uppercase characters' do
|
||||
let(:path) { 'SoMe/ImAgE' }
|
||||
|
||||
it 'return a string with a repository path' do
|
||||
expect(subject.to_s).to eq 'some/image'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -70,6 +80,12 @@ describe ContainerRegistry::Path do
|
|||
|
||||
it { is_expected.to be_valid }
|
||||
end
|
||||
|
||||
context 'when path contains uppercase letters' do
|
||||
let(:path) { 'Some/Registry' }
|
||||
|
||||
it { is_expected.to be_valid }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#has_repository?' do
|
||||
|
|
Loading…
Reference in a new issue