Pass environment to box.find
This commit is contained in:
parent
e8e2c136d3
commit
ea25f49c63
|
@ -166,7 +166,7 @@ module Vagrant
|
||||||
def load_box!
|
def load_box!
|
||||||
return unless root_path
|
return unless root_path
|
||||||
|
|
||||||
@box = Box.find(config.vm.box) if config.vm.box
|
@box = Box.find(self, config.vm.box) if config.vm.box
|
||||||
@box.env = self if @box
|
@box.env = self if @box
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -341,14 +341,14 @@ class EnvironmentTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "set the box to what is found by the Box class" do
|
should "set the box to what is found by the Box class" do
|
||||||
Vagrant::Box.expects(:find).with(@env.config.vm.box).once.returns(@box)
|
Vagrant::Box.expects(:find).with(@env, @env.config.vm.box).once.returns(@box)
|
||||||
@env.load_box!
|
@env.load_box!
|
||||||
assert @box.equal?(@env.box)
|
assert @box.equal?(@env.box)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "set the environment of the box" do
|
should "set the environment of the box" do
|
||||||
@box.expects(:env=).with(@env).once
|
@box.expects(:env=).with(@env).once
|
||||||
Vagrant::Box.expects(:find).with(@env.config.vm.box).once.returns(@box)
|
Vagrant::Box.expects(:find).with(@env, @env.config.vm.box).once.returns(@box)
|
||||||
@env.load_box!
|
@env.load_box!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue