Sha256: ee948e1790e25034db7aa8699f341b540ef53d45a404d3c4f3fd0c2274ab39dc
Contents?: true
Size: 1.19 KB
Versions: 39
Compression:
Stored size: 1.19 KB
Contents
Shindo.tests('Fog::Compute::RackspaceV2 | key_pairs', ['rackspace']) do service = Fog::Compute::RackspaceV2.new name = Fog::Mock.random_letters(32) key = nil tests("API access") do begin tests("create").succeeds do key = service.key_pairs.create({:name => name}) end tests("list all").succeeds do service.key_pairs.all end tests("get").succeeds do service.key_pairs.get(name) end tests("delete").succeeds do key = nil if service.key_pairs.destroy(name) key == nil end tests("get unknown").returns(nil) do service.key_pairs.get(Fog::Mock.random_letters(32)) end tests("delete unknown").raises(Fog::Compute::RackspaceV2::NotFound) do service.key_pairs.destroy(Fog::Mock.random_letters(32)) end tests("create again after delete").succeeds do key = service.key_pairs.create({:name => name}) end tests("create already existing").raises(Fog::Compute::RackspaceV2::ServiceError) do service.key_pairs.create({:name => name}) end ensure key.destroy if key end end end
Version data entries
39 entries across 37 versions & 6 rubygems