test/models/dns/test_zones.rb in fog-azure-rm-0.0.8 vs test/models/dns/test_zones.rb in fog-azure-rm-0.0.9

- old
+ new

@@ -3,21 +3,22 @@ # Test class for Zone Collection class TestZones < Minitest::Test def setup @service = Fog::DNS::AzureRM.new(credentials) @zones = Fog::DNS::AzureRM::Zones.new(service: @service) - @response = [ApiStub::Models::DNS::Zone.list_zones] + @dns_client1 = @service.instance_variable_get(:@dns_client) + @response = [ApiStub::Models::DNS::Zone.create_zone_obj(@dns_client1)] end def test_collection_methods methods = [ :all, :get, :check_for_zone ] methods.each do |method| - assert @zones.respond_to? method, true + assert_respond_to @zones, method end end def test_all_method_response @service.stub :list_zones, @response do @@ -28,10 +29,10 @@ end end end def test_get_method_response - response = ApiStub::Models::DNS::Zone.create_zone_obj + response = ApiStub::Models::DNS::Zone.create_zone_obj(@dns_client1) @service.stub :get_zone, response do assert_instance_of Fog::DNS::AzureRM::Zone, @zones.get('fog-test-rg', 'fog-test-zone.com') end end