Sha256: 40f7c1501a22dd1ac657a2defd89d19fe607a74da07dcda460195345bb7bc12c

Contents?: true

Size: 1.45 KB

Versions: 21

Compression:

Stored size: 1.45 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

21 entries across 19 versions & 5 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-google-0.1.0/tests/requests/dns/record_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-google-0.1.0/tests/requests/dns/record_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-google-0.1.0/tests/requests/dns/record_tests.rb
fog-google-0.1.3 tests/requests/dns/record_tests.rb
fog-google-0.1.2 tests/requests/dns/record_tests.rb
fog-google-0.1.1 tests/requests/dns/record_tests.rb
fog-google-0.1.0 tests/requests/dns/record_tests.rb
fog-google-0.0.9 tests/requests/dns/record_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-google-0.0.7/tests/requests/dns/record_tests.rb
fog-google-0.0.7 tests/requests/dns/record_tests.rb
fog-google-0.0.6 tests/requests/dns/record_tests.rb
fog-google-0.0.5 tests/requests/dns/record_tests.rb
fog-google-0.0.4 tests/requests/dns/record_tests.rb
fog-google-0.0.3 tests/requests/dns/record_tests.rb
fog-google-0.0.2 tests/requests/dns/record_tests.rb
fog-1.29.0 tests/google/requests/dns/record_tests.rb
fog-1.28.0 tests/google/requests/dns/record_tests.rb
fog-1.27.0 tests/google/requests/dns/record_tests.rb
fog-1.26.0 tests/google/requests/dns/record_tests.rb
fog-1.25.0 tests/google/requests/dns/record_tests.rb