Verify box with a string path, not pathname
This commit is contained in:
parent
79b303a1fc
commit
02cfb60387
|
@ -10,7 +10,7 @@ module Vagrant
|
||||||
def call(env)
|
def call(env)
|
||||||
begin
|
begin
|
||||||
env.ui.info "vagrant.actions.box.verify.verifying"
|
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
|
rescue Exception
|
||||||
raise Errors::BoxVerificationFailed.new
|
raise Errors::BoxVerificationFailed.new
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,7 +12,7 @@ class VerifyBoxActionTest < Test::Unit::TestCase
|
||||||
context "calling" do
|
context "calling" do
|
||||||
should "continue fine if verification succeeds" do
|
should "continue fine if verification succeeds" do
|
||||||
seq = sequence("seq")
|
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)
|
@app.expects(:call).with(@env).once.in_sequence(seq)
|
||||||
assert_nothing_raised {
|
assert_nothing_raised {
|
||||||
@instance.call(@env)
|
@instance.call(@env)
|
||||||
|
@ -20,7 +20,7 @@ class VerifyBoxActionTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "halt chain if verification fails" do
|
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
|
@app.expects(:call).with(@env).never
|
||||||
assert_raises(Vagrant::Errors::BoxVerificationFailed) {
|
assert_raises(Vagrant::Errors::BoxVerificationFailed) {
|
||||||
@instance.call(@env)
|
@instance.call(@env)
|
||||||
|
|
Loading…
Reference in New Issue