1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[openstack|image] Define get method for images

This commit is contained in:
Ferran Rodenas 2013-05-22 23:47:30 +02:00
parent 51371d1788
commit 058c3301ac
2 changed files with 6 additions and 0 deletions

View file

@ -18,6 +18,7 @@ module Fog
def find_by_id(id)
self.find {|image| image.id == id}
end
alias_method :get, :find_by_id
def public
images = load(service.list_public_images_detailed.body['images'])

View file

@ -7,6 +7,11 @@ Shindo.tests("Fog::Image[:openstack] | images", ['openstack']) do
image.id == @instance['image']['id']
end
tests('#get').succeeds do
image = Fog::Image[:openstack].images.get(@instance['image']['id'])
image.id == @instance['image']['id']
end
tests('#destroy').succeeds do
Fog::Image[:openstack].images.destroy(@instance['image']['id'])
end