tests/xenserver/models/compute/vbd_tests.rb in fog-1.22.0 vs tests/xenserver/models/compute/vbd_tests.rb in fog-1.22.1
- old
+ new
@@ -13,11 +13,11 @@
test('unplug') { vbd.respond_to? 'unplug' }
test('unplug_force') { vbd.respond_to? 'unplug_force' }
end
tests('have attributes') do
model_attribute_hash = vbd.attributes
- attributes = [
+ attributes = [
:reference,
:uuid,
:currently_attached,
:__vdi,
:__vm,
@@ -41,21 +41,21 @@
test("#{attribute}") { vbd.respond_to? attribute }
end
end
tests("The attributes hash should have key") do
attributes.each do |attribute|
- test("#{attribute}") { model_attribute_hash.has_key? attribute }
+ test("#{attribute}") { model_attribute_hash.key? attribute }
end
end
end
test('be a kind of Fog::Compute::XenServer::VBD') { vbd.kind_of? Fog::Compute::XenServer::VBD}
end
tests("A real VBD should") do
- test("have a valid OpaqueRef") do
+ test("have a valid OpaqueRef") do
puts vbd.reference
(vbd.reference =~ /OpaqueRef:/).eql?(0) and \
vbd.reference != "OpaqueRef:NULL"
end
tests("belong to a VM when attached") do
@@ -78,18 +78,18 @@
true
end
end
test("return a nil VDI when type CD") do
if vbd.type == 'CD'
- vbd.vdi.nil?
+ vbd.vdi.nil?
else
true
end
end
test("return a VbdMetrics object when attached") do
if vbd.currently_attached
- vbd.metrics.kind_of? Fog::Compute::XenServer::VbdMetrics
+ vbd.metrics.kind_of? Fog::Compute::XenServer::VbdMetrics
else
vbd.metrics.nil?
end
end
end
@@ -109,7 +109,7 @@
tests("VBD Metrics should") do
test("have a last_updated Time property") { server.vbds.first.metrics.last_updated.kind_of? Time }
end
destroy_ephemeral_servers
-
+
end