Sha256: 0c87161ccfce64d3e5cdd9d209524e17192069ca3fd0667d6e45707c0a06ced2

Contents?: true

Size: 1.37 KB

Versions: 18

Compression:

Stored size: 1.37 KB

Contents

# coding: utf-8
Shindo.tests('Fog::Network[:sakuracloud] | list_routers request', ['sakuracloud', 'network']) do

  @routers_create_format = {
    'Index'          => Integer,
    'ID'             => String,
    'Name'           => String,
    'ServerCount'    => Integer,
    'ApplianceCount' => Integer,
    'Subnets'        => Array
  }

  @routers_list_format = {
    'Index'          => Integer,
    'ID'             => String,
    'Switch'         => Hash
  }

  tests('success') do

    tests('#list_routers') do
      routers = sakuracloud_network_service.list_routers
      test 'returns a Hash' do
        routers.body.is_a? Hash
      end
      if Fog.mock?
        tests('Routers').formats(@routers_list_format, false) do
          routers.body['Internet'].first
        end
      else
        returns(200) { routers.status }
        returns(true) { routers.body.is_a? Hash }
      end
    end
  end
end

Shindo.tests('Fog::Network[:sakuracloud] | create_router request', ['sakuracloud', 'network']) do
  tests('success') do
    tests('#create_router_with_internet_access') do
      router = sakuracloud_network_service.create_router(:name => 'foobar', :networkmasklen => 28)
      test 'returns a Hash' do
        router.body.is_a? Hash
      end

      unless Fog.mock?
        returns(202) { router.status }
        returns(true) { router.body.is_a? Hash }
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
fog-sakuracloud-1.6.0 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.5.2 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.5.1 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.5.0 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.4.0 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.3.3 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.3.2 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.3.1 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.3.0 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.2.0 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.1.1 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.1.0 tests/sakuracloud/requests/network/routers_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-sakuracloud-1.0.1/tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.0.1 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.0.0 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-0.1.2 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-0.1.1 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-0.1.0 tests/sakuracloud/requests/network/routers_tests.rb