spec/helpers.rb in beaker-answers-0.4.3 vs spec/helpers.rb in beaker-answers-0.5.0
- old
+ new
@@ -80,11 +80,13 @@
def make_host name, host_hash
host_hash = StringifyHash.new.merge(HOST_DEFAULTS.merge(host_hash))
host = make_opts.merge(host_hash)
+ allow(host).to receive( :reachable_name ).and_return( name )
allow(host).to receive( :name ).and_return( name )
+ allow(host).to receive( :hostname ).and_return( host[:hostname] )
allow(host).to receive( :to_s ).and_return( name )
allow(host).to receive( :exec ).and_return( generate_result( name, host_hash ) )
host
end
@@ -92,9 +94,10 @@
hosts = []
(1..amt).each do |num|
name = HOST_NAME % num
opts = { :snapshot => HOST_SNAPSHOT % num,
:ip => HOST_IP % name,
+ :hostname => "#{name}.test",
:template => HOST_TEMPLATE % name,
:box => HOST_BOX % name,
:box_url => HOST_BOX_URL % name }.merge( preset_opts )
hosts << make_host(name, opts)
end