You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/01/25 18:19:03 UTC

git commit: Black box tests - tidy up/forgotten nits

Updated Branches:
  refs/heads/master f9ea0c116 -> c9750c82e


Black box tests - tidy up/forgotten nits


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/c9750c82
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/c9750c82
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/c9750c82

Branch: refs/heads/master
Commit: c9750c82ec53ae15b85d7aed3cac9fe5d95a6d47
Parents: f9ea0c1
Author: marios <ma...@redhat.com>
Authored: Fri Jan 25 11:53:41 2013 +0200
Committer: marios <ma...@redhat.com>
Committed: Fri Jan 25 19:17:55 2013 +0200

----------------------------------------------------------------------
 tests/deltacloud/buckets_test.rb   |    4 ++--
 tests/deltacloud/instances_test.rb |    4 ++--
 tests/deltacloud/test_setup.rb     |    3 +--
 3 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c9750c82/tests/deltacloud/buckets_test.rb
----------------------------------------------------------------------
diff --git a/tests/deltacloud/buckets_test.rb b/tests/deltacloud/buckets_test.rb
index c9ac7f5..3cff7f5 100644
--- a/tests/deltacloud/buckets_test.rb
+++ b/tests/deltacloud/buckets_test.rb
@@ -35,8 +35,8 @@ describe 'Deltacloud API buckets collection' do
   need_collection :buckets
 
   #make sure we have at least one bucket and blob to test
-  begin
 
+  if collection_supported :buckets
     @@my_bucket = random_name
     @@my_blob = random_name
     res = post(BUCKETS, :name=>@@my_bucket)
@@ -50,7 +50,7 @@ describe 'Deltacloud API buckets collection' do
     unless res.code == 200
       raise Exception.new("Failed to create blob #{@@my_blob}")
     end
-  end if collection_supported :buckets
+  end
 
   # delete the bucket/blob we created for the tests
   MiniTest::Unit.after_tests {

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c9750c82/tests/deltacloud/instances_test.rb
----------------------------------------------------------------------
diff --git a/tests/deltacloud/instances_test.rb b/tests/deltacloud/instances_test.rb
index 1522914..35b01c1 100644
--- a/tests/deltacloud/instances_test.rb
+++ b/tests/deltacloud/instances_test.rb
@@ -23,7 +23,7 @@ describe 'Deltacloud API instances collection' do
   include Deltacloud::Test::Methods
   need_collection :instances
   #make sure we have at least one instance to test
-  begin
+  if collection_supported :instances
     #keep track of what we create for deletion after tests:
     @@created_resources = {:instances=>[], :keys=>[], :images=>[], :firewalls=>[]}
     image_id = get_a("image")
@@ -33,7 +33,7 @@ describe 'Deltacloud API instances collection' do
     end
     @@my_instance_id = (res.xml/'instance')[0][:id]
     @@created_resources[:instances] << @@my_instance_id
-  end if collection_supported :instances
+  end
 
   #stop/destroy the resources we created for the tests
   MiniTest::Unit.after_tests {

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c9750c82/tests/deltacloud/test_setup.rb
----------------------------------------------------------------------
diff --git a/tests/deltacloud/test_setup.rb b/tests/deltacloud/test_setup.rb
index 4d1943c..b912e29 100644
--- a/tests/deltacloud/test_setup.rb
+++ b/tests/deltacloud/test_setup.rb
@@ -239,8 +239,7 @@ module Deltacloud::Test::Methods
 
     #convenience method for checking if collection :foo is supported:
     def collection_supported(name)
-      return true if api.collections.include?(name.to_sym)
-      false
+      api.collections.include?(name.to_sym)
     end