mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
50 lines
1.5 KiB
Ruby
50 lines
1.5 KiB
Ruby
Shindo.tests('Fog::Compute[:xenserver] | Pool model', ['xenserver']) do
|
|
|
|
pools = Fog::Compute[:xenserver].pools
|
|
pool = pools.first
|
|
|
|
tests('The Pool model should') do
|
|
tests('have the action') do
|
|
test('reload') { pool.respond_to? 'reload' }
|
|
end
|
|
tests('have attributes') do
|
|
model_attribute_hash = pool.attributes
|
|
attributes = [
|
|
:reference,
|
|
:uuid,
|
|
:name,
|
|
:description,
|
|
:__default_sr,
|
|
:__master,
|
|
:tags,
|
|
:restrictions,
|
|
:ha_enabled,
|
|
:vswitch_controller
|
|
]
|
|
tests("The Pool model should respond to") do
|
|
attributes.each do |attribute|
|
|
test("#{attribute}") { pool.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 }
|
|
end
|
|
end
|
|
end
|
|
|
|
test('be a kind of Fog::Compute::XenServer::Pool') { pool.kind_of? Fog::Compute::XenServer::Pool}
|
|
|
|
end
|
|
|
|
tests("A real Pool should") do
|
|
tests("return a valid default_storage_repository") do
|
|
test("should be a Fog::Compute::XenServer::StorageRepository") { pool.default_storage_repository.kind_of? Fog::Compute::XenServer::StorageRepository }
|
|
end
|
|
tests("return valid Host as the master") do
|
|
test("should be a Fog::Compute::XenServer::Host") { pool.master.kind_of? Fog::Compute::XenServer::Host }
|
|
end
|
|
|
|
end
|
|
|
|
end
|