Sha256: 525808d1b809d729a1767a3039a09529397a4c632044be15160bee4561545dbf

Contents?: true

Size: 1.44 KB

Versions: 14

Compression:

Stored size: 1.44 KB

Contents

Shindo.tests("Fog::DNS[:google] | record requests", ["google"]) do
  # Google requires confirmation of ownership for created domains in some cases.
  # If you want to run tests in non-mocked mode, set the environment variable to a domain you own.
  unless Fog.mocking? || ENV["FOG_TEST_GOOGLE_DNS_ZONE"]
    tests("Needs a verified domain, set $FOG_TEST_GOOGLE_DNS_ZONE").pending
  end

  @dns = Fog::DNS[:google]

  @get_resource_record_sets_format = {
    "kind" => String,
    "name" => String,
    "type" => String,
    "ttl" => Integer,
    "rrdatas" => Array
  }

  @list_resource_record_sets_format = {
    "kind" => String,
    "rrsets" => [@get_resource_record_sets_format]
  }

  tests("success") do
    @zone = @dns.zones.create(
      :name => Fog::Mock.random_letters(16),
      :domain => ENV["FOG_TEST_GOOGLE_DNS_ZONE"] || generate_unique_domain,
      :description => "Fog test domain"
    )

    tests('#list_resource_record_sets').formats(@list_resource_record_sets_format) do
      @dns.list_resource_record_sets(@zone.identity).body
    end

    tests('#list_resource_record_sets (with name and type)').formats(@list_resource_record_sets_format) do
      @dns.list_resource_record_sets(@zone.identity, :name => @zone.domain, :type => "NS").body
    end

    @zone.destroy
  end

  tests("failure") do
    tests('#list_resource_record_sets').raises(Fog::Errors::NotFound) do
      @dns.list_resource_record_sets(generate_unique_domain).body
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-google-0.6.0 tests/requests/dns/record_tests.rb
fog-google-0.5.5 tests/requests/dns/record_tests.rb
fog-google-0.5.4 tests/requests/dns/record_tests.rb
fog-google-0.5.3 tests/requests/dns/record_tests.rb
fog-google-0.5.2 tests/requests/dns/record_tests.rb
fog-google-0.5.1 tests/requests/dns/record_tests.rb
fog-google-0.5.0 tests/requests/dns/record_tests.rb
fog-google-0.4.2 tests/requests/dns/record_tests.rb
fog-google-0.4.1 tests/requests/dns/record_tests.rb
fog-google-0.4.0 tests/requests/dns/record_tests.rb
fog-google-0.3.2 tests/requests/dns/record_tests.rb
fog-google-0.3.1 tests/requests/dns/record_tests.rb
fog-google-0.3.0 tests/requests/dns/record_tests.rb
fog-google-0.2.0 tests/requests/dns/record_tests.rb