guests/debian: fix tests

This commit is contained in:
Mitchell Hashimoto 2014-05-05 09:29:23 -07:00
parent ec8b6b22ee
commit 8e334d2f24
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,12 @@ shared_examples "a debian-like host name change" do
let(:search) { Regexp.new(expression.split('@')[1], Regexp::EXTENDED) } let(:search) { Regexp.new(expression.split('@')[1], Regexp::EXTENDED) }
let(:replace) { expression.split('@')[2] } let(:replace) { expression.split('@')[2] }
let(:grep_command) { "grep '#{old_hostname}' /etc/hosts" }
before do
communicator.stub_command(grep_command, exit_code: 0)
end
it "works on an simple /etc/hosts file" do it "works on an simple /etc/hosts file" do
original_etc_hosts = <<-ETC_HOSTS.gsub(/^ */, '') original_etc_hosts = <<-ETC_HOSTS.gsub(/^ */, '')
127.0.0.1 localhost 127.0.0.1 localhost