Sha256: 57a02e2343a556957a5e9a848eecbc850875e21e1f00ef2e90a32bd2bb1b7b4d

Contents?: true

Size: 1011 Bytes

Versions: 34

Compression:

Stored size: 1011 Bytes

Contents

Shindo.tests('Fog::Compute[:google] | region requests', ['google']) do
  @google = Fog::Compute[:google]

  @get_region_format = {
      'kind' => String,
      'selfLink' => String,
      'id' => String,
      'creationTimestamp' => String,
      'name' => String,
      'description' => String,
      'status' => String,
      'zones' => Array,
      'quotas' => [{ 'metric' => String, 'limit' => Float, 'usage' => Float }],
  }

  @list_regions_format = {
      'kind' => String,
      'selfLink' => String,
      'id' => String,
      'items' => [@get_region_format]
  }

  tests('success') do
    tests("#get_region").formats(@get_region_format) do
      region = @google.list_regions.body['items'].first['name']
      @google.get_region(region).body
    end

    tests("#list_regions").formats(@list_regions_format) do
      @google.list_regions.body
    end
  end

  tests('failure') do
    tests("#get_region").raises(Fog::Errors::NotFound) do
      @google.get_region('unicorn').body
    end
  end
end

Version data entries

34 entries across 32 versions & 6 rubygems

Version Path
fog-1.25.0 tests/google/requests/compute/region_tests.rb
nsidc-fog-1.24.1 tests/google/requests/compute/region_tests.rb
fog-1.24.0 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.11 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.10 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.9 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.8 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.7 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.6 tests/google/requests/compute/region_tests.rb
fog-1.23.0 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.4 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.3 tests/google/requests/compute/region_tests.rb
ns-fog-1.22.2 tests/google/requests/compute/region_tests.rb
fog-1.22.1 tests/google/requests/compute/region_tests.rb