The `target_vms` helper in multivm with no name specified will return all VMs, not the hash [closes GH-148]

This commit is contained in:
Mitchell Hashimoto 2010-08-25 16:01:56 -07:00
parent 27d5ffa3d6
commit 83b2872ddb
2 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ module Vagrant
@target_vms ||= begin
if env.multivm?
return env.vms if !self.name
return env.vms.values if !self.name
vm = env.vms[self.name.to_sym]
raise VMNotFoundError.new("A VM by the name of `#{self.name}` was not found.") if !vm
else

View File

@ -67,7 +67,7 @@ class CommandHelpersTest < Test::Unit::TestCase
should "return all the VMs if no name is specified" do
instance = command([], @env)
assert_equal @env.vms, instance.target_vms
assert_equal @env.vms.values, instance.target_vms
end
should "return only the specified VM if a name is given" do