Fixed "busticated" provisioning due to internal changes from multivm [closes GH-65]

This commit is contained in:
Mitchell Hashimoto 2010-05-18 19:23:08 -07:00
parent 5251d89241
commit 6397ac579c
2 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@ module Vagrant
end
if provisioner.is_a?(Class)
@provisioner = provisioner.new(@runner.env)
@provisioner = provisioner.new(@runner)
raise ActionException.new(:provisioner_invalid_class) unless @provisioner.is_a?(Provisioners::Base)
elsif provisioner.is_a?(Symbol)
# We have a few hard coded provisioners for built-ins
@ -30,7 +30,7 @@ module Vagrant
provisioner_klass = mapping[provisioner]
raise ActionException.new(:provisioner_unknown_type, :provisioner => provisioner.to_s) if provisioner_klass.nil?
@provisioner = provisioner_klass.new(@runner.env)
@provisioner = provisioner_klass.new(@runner)
end
logger.info "Provisioning enabled with #{@provisioner.class}"

View File

@ -44,13 +44,13 @@ class ProvisionActionTest < Test::Unit::TestCase
@instance.stubs(:prepare)
@klass = mock("klass")
@klass.stubs(:is_a?).with(Class).returns(true)
@klass.stubs(:new).with(@runner.env).returns(@instance)
@klass.stubs(:new).with(@runner).returns(@instance)
@runner.env.config.vm.provisioner = @klass
end
should "set the provisioner to an instantiation of the class" do
@klass.expects(:new).with(@runner.env).once.returns(@instance)
@klass.expects(:new).with(@runner).once.returns(@instance)
assert_nothing_raised { @action.prepare }
assert_equal @instance, @action.provisioner
end
@ -74,7 +74,7 @@ class ProvisionActionTest < Test::Unit::TestCase
instance = mock("instance")
instance.expects(:prepare).once
provisioner.expects(:new).with(@runner.env).returns(instance)
provisioner.expects(:new).with(@runner).returns(instance)
assert_nothing_raised { @action.prepare }
assert_equal instance, @action.provisioner
end