Boxes now properly use scoped Environment

This commit is contained in:
Mitchell Hashimoto 2010-04-19 14:15:52 -07:00
parent 5b307a5d9b
commit d9308f86ec
2 changed files with 5 additions and 2 deletions

View File

@ -126,7 +126,7 @@ module Vagrant
# #
# @return [String] # @return [String]
def ovf_file def ovf_file
File.join(directory, Vagrant.config.vm.box_ovf) File.join(directory, env.config.vm.box_ovf)
end end
# Begins the process of adding a box to the vagrant installation. This # Begins the process of adding a box to the vagrant installation. This

View File

@ -112,6 +112,7 @@ class BoxTest < Test::Unit::TestCase
context "instance methods" do context "instance methods" do
setup do setup do
@box = Vagrant::Box.new @box = Vagrant::Box.new
@box.env = mock_environment
end end
should "execute the Add action when add is called" do should "execute the Add action when add is called" do
@ -141,10 +142,12 @@ class BoxTest < Test::Unit::TestCase
context "ovf file" do context "ovf file" do
setup do setup do
@box.stubs(:directory).returns("foo") @box.stubs(:directory).returns("foo")
@box.env.config.vm.box_ovf = "foo.ovf"
end end
should "be the directory joined with the config ovf file" do should "be the directory joined with the config ovf file" do
assert_equal File.join(@box.directory, Vagrant.config.vm.box_ovf), @box.ovf_file assert_equal File.join(@box.directory, @box.env.config.vm.box_ovf), @box.ovf_file
end end
end end
end end