Sha256: c90c4211ff0caff83c63ed92f2822604c300e8379a4266e81a3e692a022cb961

Contents?: true

Size: 1.71 KB

Versions: 18

Compression:

Stored size: 1.71 KB

Contents

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

  @regions_format = {
    'regionInfo'  => [{
      'regionEndpoint'  => String,
      'regionName'      => String
    }],
    'requestId'   => String
  }

  tests('success') do

    tests("#describe_regions").formats(@regions_format) do
      Fog::Compute[:aws].describe_regions.body
    end

    tests("#describe_regions('region-name' => 'us-east-1')").formats(@regions_format) do
      Fog::Compute[:aws].describe_regions('region-name' => 'us-east-1').body
    end

    tests("#incorrect_region") do

      raises(ArgumentError, "Unknown region: world-antarctica-1") do
        Fog::AWS::Compute.new({:aws_access_key_id => 'dummykey',
                :aws_secret_access_key => 'dummysecret',
                :aws_session_token => 'dummytoken',
                :region => 'world-antarctica-1'})
      end

    end

    tests("#unknown_endpoint").formats(@regions_format) do
      Fog::AWS::Compute.new({:aws_access_key_id => 'dummykey',
                             :aws_secret_access_key => 'dummysecret',
                             :aws_session_token => 'dummytoken',
                             :region => 'world-antarctica-1',
                             :endpoint => 'http://aws-clone.example'}).describe_regions.body
    end

    tests("#invalid_endpoint") do
      raises(Fog::AWS::Compute::InvalidURIError) do
        Fog::AWS::Compute.new({:aws_access_key_id => 'dummykey',
                             :aws_secret_access_key => 'dummysecret',
                             :aws_session_token => 'dummytoken',
                             :region => 'world-antarctica-1',
                             :endpoint => 'aws-clone.example'})
      end
    end

  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fog-aws-3.12.0 tests/requests/compute/region_tests.rb
fog-aws-3.11.0 tests/requests/compute/region_tests.rb
fog-aws-3.10.0 tests/requests/compute/region_tests.rb
fog-aws-3.9.0 tests/requests/compute/region_tests.rb
fog-aws-3.8.0 tests/requests/compute/region_tests.rb
fog-aws-3.7.0 tests/requests/compute/region_tests.rb
fog-aws-3.6.7 tests/requests/compute/region_tests.rb
fog-aws-3.6.6 tests/requests/compute/region_tests.rb
fog-aws-3.6.5 tests/requests/compute/region_tests.rb
fog-aws-3.6.4 tests/requests/compute/region_tests.rb
fog-aws-3.6.3 tests/requests/compute/region_tests.rb
fog-aws-3.6.2 tests/requests/compute/region_tests.rb
fog-aws-3.5.2 tests/requests/compute/region_tests.rb
fog-aws-3.5.1 tests/requests/compute/region_tests.rb
fog-aws-3.5.0 tests/requests/compute/region_tests.rb
fog-aws-3.4.0 tests/requests/compute/region_tests.rb
fog-aws-3.3.0 tests/requests/compute/region_tests.rb
fog-aws-3.2.0 tests/requests/compute/region_tests.rb