Verify box with a string path, not pathname

This commit is contained in:
Mitchell Hashimoto 2010-09-12 15:39:37 -06:00
parent 79b303a1fc
commit 02cfb60387
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ module Vagrant
def call(env)
begin
env.ui.info "vagrant.actions.box.verify.verifying"
VirtualBox::Appliance.new(env["box"].ovf_file)
VirtualBox::Appliance.new(env["box"].ovf_file.to_s)
rescue Exception
raise Errors::BoxVerificationFailed.new
end

View File

@ -12,7 +12,7 @@ class VerifyBoxActionTest < Test::Unit::TestCase
context "calling" do
should "continue fine if verification succeeds" do
seq = sequence("seq")
VirtualBox::Appliance.expects(:new).with(@env["box"].ovf_file).in_sequence(seq)
VirtualBox::Appliance.expects(:new).with(@env["box"].ovf_file.to_s).in_sequence(seq)
@app.expects(:call).with(@env).once.in_sequence(seq)
assert_nothing_raised {
@instance.call(@env)
@ -20,7 +20,7 @@ class VerifyBoxActionTest < Test::Unit::TestCase
end
should "halt chain if verification fails" do
VirtualBox::Appliance.expects(:new).with(@env["box"].ovf_file).raises(Exception)
VirtualBox::Appliance.expects(:new).with(@env["box"].ovf_file.to_s).raises(Exception)
@app.expects(:call).with(@env).never
assert_raises(Vagrant::Errors::BoxVerificationFailed) {
@instance.call(@env)