2016-12-06 23:20:29 +01:00
|
|
|
require 'spec_helper'
|
2014-07-04 11:09:00 -06:00
|
|
|
|
|
|
|
|
describe VagrantPlugins::ProviderLibvirt::Action::SetNameOfDomain do
|
|
|
|
|
before :each do
|
|
|
|
|
@env = EnvironmentHelper.new
|
|
|
|
|
end
|
|
|
|
|
|
2016-12-06 23:20:29 +01:00
|
|
|
it 'builds unique domain name' do
|
2014-07-31 09:31:30 -06:00
|
|
|
@env.random_hostname = true
|
2014-07-04 11:09:00 -06:00
|
|
|
dmn = VagrantPlugins::ProviderLibvirt::Action::SetNameOfDomain.new(Object.new, @env)
|
|
|
|
|
first = dmn.build_domain_name(@env)
|
|
|
|
|
second = dmn.build_domain_name(@env)
|
2015-04-15 09:45:29 +02:00
|
|
|
first.should_not eq(second)
|
2014-07-04 11:09:00 -06:00
|
|
|
end
|
2014-07-31 09:31:30 -06:00
|
|
|
|
2016-12-06 23:20:29 +01:00
|
|
|
it 'builds simple domain name' do
|
2018-04-18 10:59:19 -04:00
|
|
|
@env.default_prefix = 'pre_'
|
2014-07-31 09:31:30 -06:00
|
|
|
dmn = VagrantPlugins::ProviderLibvirt::Action::SetNameOfDomain.new(Object.new, @env)
|
2015-04-15 09:45:29 +02:00
|
|
|
dmn.build_domain_name(@env).should eq('pre_')
|
2014-07-31 09:31:30 -06:00
|
|
|
end
|
2014-07-04 11:09:00 -06:00
|
|
|
end
|