lib/torpedo/compute/images.rb in torpedo-1.0.19 vs lib/torpedo/compute/images.rb in torpedo-2.1.0

- old
+ new

@@ -1,35 +1,35 @@ require File.dirname(__FILE__) + '/helper' module Torpedo -module Compute -class Images < Test::Unit::TestCase + module Compute + class Images < Test::Unit::TestCase - def setup - @conn=Helper::get_connection - @image_id = Helper::get_image_ref(@conn) - end + def setup + @conn=Helper::get_connection + @image_id = Helper::get_image_ref(@conn) + end - def test_list + def test_list - @conn.images.each do |image| - assert_not_nil(image[:id]) - assert_not_nil(image[:name]) - assert_not_nil(image[:status]) - end + @conn.images.each do |image| + assert_not_nil(image.id) + assert_not_nil(image.name) + assert_not_nil(image.status) + end - end + end - def test_get + def test_get - image=@conn.image(@image_id) - assert_equal(@image_id, image.id.to_s) - assert_not_nil(image.name) - assert_not_nil(image.updated) - assert_not_nil(image.created) - assert_not_nil(image.status) + image=@conn.images.get(@image_id) + assert_equal(@image_id, image.id.to_s) + assert_not_nil(image.name) + assert_not_nil(image.updated_at) + assert_not_nil(image.created_at) + assert_not_nil(image.status) - end + end -end -end + end + end end