mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Update hostname_shorten and callers
This commit is contained in:
parent
35dc7cb26f
commit
0119126cd1
3 changed files with 394 additions and 34 deletions
|
|
@ -16,14 +16,12 @@ describe Vmpooler::API::Helpers do
|
|||
|
||||
describe '#hostname_shorten' do
|
||||
[
|
||||
['example.com', 'not-example.com', 'example'],
|
||||
['example.com', 'example.com', 'example'],
|
||||
['sub.example.com', 'example.com', 'sub'],
|
||||
['adjective-noun.example.com', 'example.com', 'adjective-noun'],
|
||||
['abc123.example.com', 'example.com', 'abc123'],
|
||||
['example.com', nil, 'example']
|
||||
].each do |hostname, domain, expected|
|
||||
it { expect(subject.hostname_shorten(hostname, domain)).to eq expected }
|
||||
['example.com', 'example'],
|
||||
['sub.example.com', 'sub'],
|
||||
['adjective-noun.example.com', 'adjective-noun'],
|
||||
['abc123.example.com', 'abc123']
|
||||
].each do |hostname, expected|
|
||||
it { expect(subject.hostname_shorten(hostname)).to eq expected }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue