Files
vagrant-libvirt/spec/unit/action/set_name_of_domain_spec.rb

22 lines
646 B
Ruby
Raw Normal View History

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
@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
2016-12-06 23:20:29 +01:00
it 'builds simple domain name' do
@env.default_prefix = 'pre_'
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_')
end
2014-07-04 11:09:00 -06:00
end