1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/ovirt/requests/compute/destroy_vm_tests.rb
Amos Benari 905c69d424 oVirt: Added tests to work on both real and mock.
Signed-off-by: Ohad Levy <ohadlevy@gmail.com>
2012-02-08 09:36:07 -06:00

18 lines
595 B
Ruby

Shindo.tests('Fog::Compute[:ovirt] | vm_destroy request', ['ovirt']) do
compute = Fog::Compute[:ovirt]
if compute.servers.all(:search => 'fog-*').empty?
compute.create_vm(:name => 'fog-'+Time.now.to_i.to_s, :cluster_name => 'Default')
end
vm_id = compute.servers.all(:search => 'fog-*').last.id
tests('The response should') do
response = compute.destroy_vm(:id => vm_id)
test('be a success') { response ? true: false }
end
tests('The expected options') do
raises(ArgumentError, 'raises ArgumentError when id option is missing') { compute.destroy_vm }
end
end