VM now has a `uuid` method
This commit is contained in:
parent
575e91e70b
commit
62d3172e57
|
@ -19,6 +19,10 @@ module Vagrant
|
||||||
@vm = vm
|
@vm = vm
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def uuid
|
||||||
|
@vm.uuid
|
||||||
|
end
|
||||||
|
|
||||||
def reload!
|
def reload!
|
||||||
@vm = VirtualBox::VM.find(@vm.uuid)
|
@vm = VirtualBox::VM.find(@vm.uuid)
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,6 +38,14 @@ class VMTest < Test::Unit::TestCase
|
||||||
@mock_vm.stubs(:uuid).returns("foo")
|
@mock_vm.stubs(:uuid).returns("foo")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "uuid" do
|
||||||
|
should "call UUID on VM object" do
|
||||||
|
uuid = mock("uuid")
|
||||||
|
@mock_vm.expects(:uuid).once.returns(uuid)
|
||||||
|
assert_equal uuid, @vm.uuid
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "reloading" do
|
context "reloading" do
|
||||||
should "load the same VM and set it" do
|
should "load the same VM and set it" do
|
||||||
new_vm = mock("vm")
|
new_vm = mock("vm")
|
||||||
|
|
Loading…
Reference in New Issue