Files
vagrant-libvirt/spec/support/environment_helper.rb

49 lines
844 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2016-12-06 23:20:29 +01:00
require 'ostruct'
require 'pathname'
2014-07-04 11:09:00 -06:00
class EnvironmentHelper
attr_writer :domain_name
2014-07-04 11:09:00 -06:00
attr_accessor :random_hostname, :name, :default_prefix
2014-07-04 11:09:00 -06:00
def [](value)
2016-12-06 23:20:29 +01:00
send(value.to_sym)
2014-07-04 11:09:00 -06:00
end
2015-04-15 09:45:29 +02:00
def cpus
4
end
def memory
1024
end
%w(cpus cpu_mode loader nvram boot_order machine_type disk_bus disk_device nested volume_cache kernel cmd_line initrd graphics_type graphics_autoport graphics_port graphics_ip graphics_passwd video_type video_vram keymap storage_pool_name disks cdroms driver).each do |name|
2015-04-15 09:45:29 +02:00
define_method(name.to_sym) do
nil
end
end
2014-07-04 11:09:00 -06:00
def machine
self
end
def provider_config
self
end
def root_path
2016-12-06 23:20:29 +01:00
Pathname.new('./spec/support/foo')
2014-07-04 11:09:00 -06:00
end
def domain_name
2016-12-06 23:20:29 +01:00
# noop
2014-07-04 11:09:00 -06:00
end
def libvirt_compute
OpenStruct.new(servers: [])
end
end