Files
vagrant-libvirt/spec/unit/action/set_name_of_domain_spec.rb
Darragh Bailey 18ebb9d9ed Enable frozen string across project (#1319)
Turn on frozen string support in all files by using a comment to avoid
enabling across dependencies where it may not work.

Fixes: #1177
2021-06-30 13:27:03 +01:00

24 lines
685 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe VagrantPlugins::ProviderLibvirt::Action::SetNameOfDomain do
before :each do
@env = EnvironmentHelper.new
end
it 'builds unique domain name' do
@env.random_hostname = true
dmn = VagrantPlugins::ProviderLibvirt::Action::SetNameOfDomain.new(Object.new, @env)
first = dmn.build_domain_name(@env)
second = dmn.build_domain_name(@env)
expect(first).to_not eq(second)
end
it 'builds simple domain name' do
@env.default_prefix = 'pre_'
dmn = VagrantPlugins::ProviderLibvirt::Action::SetNameOfDomain.new(Object.new, @env)
expect(dmn.build_domain_name(@env)).to eq('pre_')
end
end