Sha256: 35dbd49275706c435370094c2e10f6bdcdd8071b09a7ebec9552daee6308efbe

Contents?: true

Size: 1.2 KB

Versions: 27

Compression:

Stored size: 1.2 KB

Contents

# coding: utf-8
Shindo.tests('Fog::Compute[:sakuracloud] | list_servers request', ['sakuracloud', 'compute']) do

  @servers_format = {
    'Index'        => Integer,
    'ID'           => Integer,
    'Name'         => String,
    'ServerPlan'   => Hash,
    'Instance'     => Hash,
    'Disks'        => Array
  }

  tests('success') do

    tests('#list_servers') do
      servers = sakuracloud_compute_service.list_servers
      test 'returns a Hash' do
        servers.body.is_a? Hash
      end
      if Fog.mock?
        tests('Servers').formats(@servers_format, false) do
          servers.body['Servers'].first
        end
      else
        returns(200) { servers.status }
        returns(true) { servers.body.is_a? Hash }
      end
    end
  end
end

Shindo.tests('Fog::Compute[:sakuracloud] | create_servers request', ['sakuracloud', 'compute']) do
  tests('success') do
    tests('#create_servers') do
      servers = sakuracloud_compute_service.create_server(:name => 'foobar', :serverplan => 2001)
      test 'returns a Hash' do
        servers.body.is_a? Hash
      end

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

Version data entries

27 entries across 25 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/compute/servers_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/compute/servers_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.7.5 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.7.4 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.7.3 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.7.2 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.7.1 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.7.0 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.6.0 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.5.2 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.5.1 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.5.0 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.4.0 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.3.3 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.3.2 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.3.1 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.3.0 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.2.0 tests/sakuracloud/requests/compute/servers_tests.rb
fog-sakuracloud-1.1.1 tests/sakuracloud/requests/compute/servers_tests.rb