You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/04/04 08:54:35 UTC
[5/6] git commit: Client: Updated tests for #url and InstanceAddress
(DTACLOUD-523)
Client: Updated tests for #url and InstanceAddress (DTACLOUD-523)
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/42fad4f3
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/42fad4f3
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/42fad4f3
Branch: refs/heads/master
Commit: 42fad4f3db9f4837da02cc32534bf24cda8a5f19
Parents: ff137e0
Author: Michal Fojtik <mf...@redhat.com>
Authored: Wed Apr 3 16:08:15 2013 +0200
Committer: Michal fojtik <mf...@redhat.com>
Committed: Thu Apr 4 08:54:12 2013 +0200
----------------------------------------------------------------------
client/tests/methods/instance_test.rb | 6 ++++++
client/tests/models/image_test.rb | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/42fad4f3/client/tests/methods/instance_test.rb
----------------------------------------------------------------------
diff --git a/client/tests/methods/instance_test.rb b/client/tests/methods/instance_test.rb
index 47b3934..4abe1b2 100644
--- a/client/tests/methods/instance_test.rb
+++ b/client/tests/methods/instance_test.rb
@@ -50,6 +50,12 @@ describe Deltacloud::Client::Methods::Instance do
@client.must_respond_to :instance
result = @client.instance('inst1')
result.must_be_instance_of Deltacloud::Client::Instance
+ result.public_addresses.wont_be_empty
+ result.public_addresses.first[:type].must_equal :hostname
+ result.public_addresses.first.type.must_equal :hostname
+ result.public_addresses.first[:value].must_equal 'img1.inst1.public.com'
+ result.public_addresses.first.value.must_equal 'img1.inst1.public.com'
+ result.public_addresses.first.to_s.must_equal 'img1.inst1.public.com'
lambda { @client.instance(nil) }.must_raise Deltacloud::Client::NotFound
lambda { @client.instance('foo') }.must_raise Deltacloud::Client::NotFound
end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/42fad4f3/client/tests/models/image_test.rb
----------------------------------------------------------------------
diff --git a/client/tests/models/image_test.rb b/client/tests/models/image_test.rb
index 6c32d06..a9305ed 100644
--- a/client/tests/models/image_test.rb
+++ b/client/tests/models/image_test.rb
@@ -58,6 +58,8 @@ describe Deltacloud::Client::Image do
it 'supports #id' do
img = @client.image('img1')
lambda { img.id.must_equal 'img1' }.must_output nil, "[DEPRECATION] `id` is deprecated because of a possible conflict with Object#id. Use `_id` instead.\n"
+ img.must_respond_to :url
+ img.url.must_equal 'http://localhost:3001/api/images/img1'
end
end