Skip to content

Commit

Permalink
(PE-14271) Have mock hosts return a hostname
Browse files Browse the repository at this point in the history
Because BeakerAnswers sets hiera host parameters from Host#hostname, so
the method needs to exist in our mocks.
  • Loading branch information
jpartlow committed May 26, 2016
1 parent 0f72aaa commit 53e9021
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spec/beaker-pe/install/pe_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def slice_installer_options(host)
expect(subject).to receive(:create_remote_file).with(
master,
'/tmp/pe.conf',
%r{\{.*"puppet_enterprise::puppet_master_host": "#{master}"}m
%r{\{.*"puppet_enterprise::puppet_master_host": "#{master.hostname}"}m
)
subject.generate_installer_conf_file_for(master, hosts, opts)
end
Expand Down
1 change: 1 addition & 0 deletions spec/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def make_host name, host_hash
host = make_opts.merge(host_hash)

allow(host).to receive( :name ).and_return( name )
allow(host).to receive( :hostname ).and_return( "#{name}.test" )
allow(host).to receive( :to_s ).and_return( name )
allow(host).to receive( :exec ).and_return( generate_result( name, host_hash ) )
host
Expand Down

0 comments on commit 53e9021

Please sign in to comment.