From 98e60cee198c3ade38b01560ffa0ffe43650cb21 Mon Sep 17 00:00:00 2001 From: Benton Roberts Date: Thu, 8 Sep 2011 13:04:46 -0400 Subject: [PATCH] [aws|elasticache] use Formatador for testing output --- tests/aws/models/elasticache/cluster_tests.rb | 8 ++++++-- tests/aws/requests/elasticache/cache_cluster_tests.rb | 7 +++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/aws/models/elasticache/cluster_tests.rb b/tests/aws/models/elasticache/cluster_tests.rb index fb5690e3f..493563b96 100644 --- a/tests/aws/models/elasticache/cluster_tests.rb +++ b/tests/aws/models/elasticache/cluster_tests.rb @@ -9,17 +9,21 @@ Shindo.tests('AWS::Elasticache | cache clusters', ['aws', 'elasticache']) do pending if Fog.mocking? + Formatador.display_line "Creating cluster #{cluster_params[:id]}..." model_tests(AWS[:elasticache].clusters, cluster_params, false) do @instance.reload # Reload to get the cluster info from AWS - puts "Waiting for #{@instance.id} to become available (#{@instance.status})..." + Formatador.display_line "Waiting for #{@instance.id} "+ + "to become available (#{@instance.status})..." @instance.wait_for {ready?} end # Single model is still deleting, so re-randomize the cluster ID cluster_params[:id] = "fog-test-cluster-#{rand(999).to_s}" + Formatador.display_line "Creating cluster #{cluster_params[:id]}..." collection_tests(AWS[:elasticache].clusters, cluster_params, false) do @instance.reload # Reload to get the cluster info from AWS - puts "Waiting for #{@instance.id} to become available (#{@instance.status})..." + Formatador.display_line "Waiting for #{@instance.id} "+ + "to become available (#{@instance.status})..." @instance.wait_for {ready?} end diff --git a/tests/aws/requests/elasticache/cache_cluster_tests.rb b/tests/aws/requests/elasticache/cache_cluster_tests.rb index 417a7ee6c..9e4a41ed5 100644 --- a/tests/aws/requests/elasticache/cache_cluster_tests.rb +++ b/tests/aws/requests/elasticache/cache_cluster_tests.rb @@ -48,12 +48,11 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache'] body end - puts "Waiting for cluster #{cluster_id} to become available..." - cluster = AWS[:elasticache].clusters.find {|c| c.id == cluster_id} - cluster.wait_for {ready?} # This doesn't work (entity disappears) + Formatador.display_line "Waiting for cluster #{cluster_id}..." + AWS[:elasticache].clusters.get(cluster_id).wait_for {ready?} tests( - '#delete_cache_security_group' + '#delete_cache_clusters' ).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do body = AWS[:elasticache].delete_cache_cluster(cluster_id).body # make sure this particular cluster is in the returned list