test/models/application_gateway/test_gateways.rb in fog-azure-rm-0.0.5 vs test/models/application_gateway/test_gateways.rb in fog-azure-rm-0.0.6

- old
+ new

@@ -4,11 +4,11 @@ class TestGateways < Minitest::Test def setup @service = Fog::ApplicationGateway::AzureRM.new(credentials) @gateways = Fog::ApplicationGateway::AzureRM::Gateways.new(resource_group: 'fog-test-rg', service: @service) @gateway_client = @service.instance_variable_get(:@network_client) - @response = [ApiStub::Models::ApplicationGateway::Gateway.create_application_gateway_response(@gateway_client)] + @response = ApiStub::Models::ApplicationGateway::Gateway.create_application_gateway_response(@gateway_client) end def test_collection_methods methods = [ :all, @@ -22,21 +22,21 @@ def test_collection_attributes assert @gateways.respond_to? :resource_group end def test_all_method_response - @service.stub :list_application_gateways, @response do + response = [@response] + @service.stub :list_application_gateways, response do assert_instance_of Fog::ApplicationGateway::AzureRM::Gateways, @gateways.all assert @gateways.all.size >= 1 @gateways.all.each do |application_gateway| assert_instance_of Fog::ApplicationGateway::AzureRM::Gateway, application_gateway end end end def test_get_method_response - @service.stub :list_application_gateways, @response do - assert_instance_of Fog::ApplicationGateway::AzureRM::Gateway, @gateways.get('gateway') - assert @gateways.get('wrong-name').nil?, true + @service.stub :get_application_gateway, @response do + assert_instance_of Fog::ApplicationGateway::AzureRM::Gateway, @gateways.get('fog-test-rg', 'gateway') end end end