From 1f69f616ad7aba1bae932df4d4360c2d6a3321a9 Mon Sep 17 00:00:00 2001 From: Eugene Howe Date: Wed, 21 Sep 2016 15:12:32 -0400 Subject: [PATCH] fix tests --- lib/fog/aws/models/support/trusted_advisor_check.rb | 3 +-- lib/fog/aws/support.rb | 4 ++++ tests/requests/support/trusted_advisor_check_tests.rb | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/fog/aws/models/support/trusted_advisor_check.rb b/lib/fog/aws/models/support/trusted_advisor_check.rb index 94829c5f3..aedf92e65 100644 --- a/lib/fog/aws/models/support/trusted_advisor_check.rb +++ b/lib/fog/aws/models/support/trusted_advisor_check.rb @@ -26,7 +26,6 @@ module Fog if attributes[:flagged_resources] map_flagged_resources! - attributes[:flagged_resources] = map_resources(attributes[:flagged_resources]) service.flagged_resources.load(attributes[:flagged_resources]) else nil @@ -41,7 +40,7 @@ module Fog def category_specific_summary(lazy=true) populate_extended_attributes(lazy) if attributes[:category_specific_summary].nil? - attributes[:category_specific_summary] + attributes[:category_stecific_summary] end def resources_summary(lazy=true) diff --git a/lib/fog/aws/support.rb b/lib/fog/aws/support.rb index db58872b2..089b3a472 100644 --- a/lib/fog/aws/support.rb +++ b/lib/fog/aws/support.rb @@ -68,6 +68,10 @@ module Fog @data = nil end + def reset + self.class.reset + end + attr_accessor :region def initialize(options={}) diff --git a/tests/requests/support/trusted_advisor_check_tests.rb b/tests/requests/support/trusted_advisor_check_tests.rb index 9eddfc7ab..366afd9d8 100644 --- a/tests/requests/support/trusted_advisor_check_tests.rb +++ b/tests/requests/support/trusted_advisor_check_tests.rb @@ -3,6 +3,11 @@ Shindo.tests("AWS::Support | describe_trusted_advisor_checks", ['aws', 'support' Fog::AWS[:support].describe_trusted_advisor_checks.body end + # things get weird in the mocked data depending on the order the model and requests run in + if Fog.mocking? + Fog::AWS[:support].reset + end + @check_id = Fog::AWS[:support].describe_trusted_advisor_checks.body['checks'].first['id'] tests("#describe_trusted_advisor_check_result(id: #{@check_id})").formats(AWS::Support::Formats::DESCRIBE_TRUSTED_ADVISOR_CHECK_RESULT) do