ssh-config should require root path, not a created environment

This commit is contained in:
Mitchell Hashimoto 2010-04-12 21:03:13 -07:00
parent c630b028fc
commit 8218395546
2 changed files with 9 additions and 1 deletions

View File

@ -64,7 +64,7 @@ module Vagrant
# Outputs a valid entry for .ssh/config which can be used to connect
# to this environment.
def ssh_config
env.require_persisted_vm
env.require_root_path
puts TemplateRenderer.render("ssh_config", {
:host_key => "vagrant",
:ssh_user => env.config.ssh.username,

View File

@ -113,6 +113,14 @@ class CommandsTest < Test::Unit::TestCase
@ssh = mock("ssh")
@ssh.stubs(:port).returns(2197)
@env.stubs(:ssh).returns(@ssh)
@env.stubs(:require_root_path)
@commands.stubs(:puts)
end
should "require root path" do
@env.expects(:require_root_path).once
@commands.ssh_config
end
should "output rendered template" do