update the action_env test helper for the new environment structure

This commit is contained in:
John Bender 2012-01-31 23:37:41 -08:00
parent fd54cf0809
commit ea9dadd41e
1 changed files with 4 additions and 1 deletions

View File

@ -78,8 +78,11 @@ module Vagrant
# given vagrant environment. This allows for testing of middlewares.
def action_env(v_env = nil)
v_env ||= vagrant_env
# duplicate the Vagrant::Environment ui and get the default vm object
# for the new action environment from the first pair in the vms list
opts = {:ui => v_env.ui.dup, :vm => v_env.vms.first.last}
app = lambda { |env| }
env = Vagrant::Action::Environment.new(v_env)
env = Vagrant::Action::Environment.new(opts)
env["vagrant.test"] = true
[app, env]
end