1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/vsphere
Kelsey Hightower a65db7f594 (#10570) Update Fog::Compute::Vsphere tests
Update `Fog::Compute::Vsphere` tests to reflect the way the
`Fog::Compute::Vsphere#convert_vm_mob_ref_to_attr_hash` method currently
converts a `RbVmomi::VIM::ManagedObject` object to a hash.

Without this patch, tests related to converting an instance of
`RbVmomi::VIM::ManagedObject` to a hash will raise an exception:
NoMethodError: undefined method `collect!' for Hash; causing the test to
fail.

This patch solves the problem by mocking `RbVmomi::VIM::ManagedObject`
with a new `MockManagedObject` class, which provides a `collect!`
method, and the `_ref` and `parent` attributes.

This patch renames fake_vm to fake_vm_mob_ref in order to provide a
more descriptive name for what's actually being tested.

The `Fog::Compute::Vshpere::Mock` class has been updated to require the
rbvmomi library, which prevents an `NameError` exception from being raised
due to the `Fog::Compute::Vsphere::Shared::RbVmomi` constant not being
initialized.

The `Fog::Compute::Vshpere::Mock` class has been updated with a
`get_folder_path` method, which prevents a `NoMethodError` exception
from being raised due to the `get_folder_path` method being undefined.
2011-11-08 02:03:13 -05:00
..
models/compute Refactor requests to return simple hashes and add unit tests 2011-09-10 15:11:18 -07:00
requests/compute [vsphere|compute] mark test requiring guid pending, as require can not be found 2011-09-22 19:54:11 -05:00
compute_tests.rb (#10570) Update Fog::Compute::Vsphere tests 2011-11-08 02:03:13 -05:00