Sha256: 52ead198f2b86caa2c4016a87b5aa41e7956acf56bab24f45d5620790b0f42df

Contents?: true

Size: 1.37 KB

Versions: 9

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,
    'BandWidthMbps'  => Integer,
    'NetworkMaskLen' => Integer,
    'Switch'         => Hash
  }

  @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

9 entries across 7 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/network/routers_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/network/routers_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.7.5 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.7.4 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.7.3 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.7.2 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.7.1 tests/sakuracloud/requests/network/routers_tests.rb
fog-sakuracloud-1.7.0 tests/sakuracloud/requests/network/routers_tests.rb