hobo-down now properly uses the new Hobo::VM object rather than a pure VBox VM object.
This commit is contained in:
parent
652a157d51
commit
32816419f5
|
@ -12,9 +12,7 @@ module Hobo
|
||||||
# Tear down a virtual machine.
|
# Tear down a virtual machine.
|
||||||
def down
|
def down
|
||||||
Env.require_persisted_vm
|
Env.require_persisted_vm
|
||||||
|
Env.persisted_vm.destroy
|
||||||
HOBO_LOGGER.info "Destroying VM and associated drives..."
|
|
||||||
Env.persisted_vm.destroy(:destroy_image => true)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Finds a virtual machine by a given UUID and either returns
|
# Finds a virtual machine by a given UUID and either returns
|
||||||
|
@ -38,6 +36,11 @@ module Hobo
|
||||||
setup_shared_folder
|
setup_shared_folder
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
HOBO_LOGGER.info "Destroying VM and associated drives..."
|
||||||
|
@vm.destroy(:destroy_image => true)
|
||||||
|
end
|
||||||
|
|
||||||
def import
|
def import
|
||||||
HOBO_LOGGER.info "Importing base VM (#{Hobo.config[:vm][:base]})..."
|
HOBO_LOGGER.info "Importing base VM (#{Hobo.config[:vm][:base]})..."
|
||||||
@vm = VirtualBox::VM.import(File.expand_path(Hobo.config[:vm][:base]))
|
@vm = VirtualBox::VM.import(File.expand_path(Hobo.config[:vm][:base]))
|
||||||
|
|
|
@ -19,7 +19,7 @@ class VMTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "destroy the persisted VM and the VM image" do
|
should "destroy the persisted VM and the VM image" do
|
||||||
@persisted_vm.expects(:destroy).with(:destroy_image => true).once
|
@persisted_vm.expects(:destroy).once
|
||||||
Hobo::VM.down
|
Hobo::VM.down
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -64,6 +64,13 @@ class VMTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "destroying" do
|
||||||
|
should "destoy the VM along with images" do
|
||||||
|
@mock_vm.expects(:destroy).with(:destroy_image => true).once
|
||||||
|
@vm.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "importing" do
|
context "importing" do
|
||||||
should "call import on VirtualBox::VM with the proper base" do
|
should "call import on VirtualBox::VM with the proper base" do
|
||||||
VirtualBox::VM.expects(:import).once
|
VirtualBox::VM.expects(:import).once
|
||||||
|
|
Loading…
Reference in New Issue