1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/rackspace/models/compute_v2/keypairs_tests.rb

33 lines
742 B
Ruby

Shindo.tests('Fog::Compute::RackspaceV2 | keypairs', ['rackspace']) do
service = Fog::Compute::RackspaceV2.new
name = Fog::Mock.random_letters(32)
tests("success") do
tests("#create").succeeds do
service.keypairs.create({:name => name})
end
tests("#all").succeeds do
service.keypairs.all
end
tests("#get").succeeds do
service.keypairs.get(name)
end
tests("#delete").succeeds do
service.keypairs.destroy(name)
end
end
tests('failure') do
tests("unknown_get").returns(nil) do
service.keypairs.get(Fog::Mock.random_letters(32))
end
tests("unknown_delete").returns(true) do
service.keypairs.destroy(Fog::Mock.random_letters(32))
end
end
end