Sha256: 431b3f808e54732b2e6b706299688961189b3d96c917d6b6bfa00768c198e8ea

Contents?: true

Size: 1.2 KB

Versions: 14

Compression:

Stored size: 1.2 KB

Contents

# coding: utf-8
Shindo.tests('Fog::Volume[:sakuracloud] | list_disks request', ['sakuracloud', 'volume']) do

  @disks_format = {
    'Index'        => Integer,
    'ID'           => Integer,
    'Name'         => String,
    'Connection'   => String,
    'Availability' => String,
    'SizeMB'       => Integer,
    'Plan'         => Hash
  }

  tests('success') do

    tests('#list_disks') do
      disks = sakuracloud_volume_service.list_disks
      test 'returns a Hash' do
        disks.body.is_a? Hash
      end
      if Fog.mock?
        tests('Disks').formats(@disks_format, false) do
          disks.body['Disks'].first
        end
      else
        returns(200) { disks.status }
        returns(true) { disks.body.is_a? Hash }
      end
    end
  end
end

Shindo.tests('Fog::Volume[:sakuracloud] | create_disks request', ['sakuracloud', 'volume']) do
  tests('success') do
    tests('#create_disks') do
      disks = sakuracloud_volume_service.create_disk('foobar', 4, {:sourcearchive => 112500463685})
      test 'returns a Hash' do
        disks.body.is_a? Hash
      end

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

Version data entries

14 entries across 12 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/volume/disks_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/volume/disks_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-sakuracloud-1.7.5/tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.7.5 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.7.4 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.7.3 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.7.2 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.7.1 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.7.0 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.6.0 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.5.2 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.5.1 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.5.0 tests/sakuracloud/requests/volume/disks_tests.rb
fog-sakuracloud-1.4.0 tests/sakuracloud/requests/volume/disks_tests.rb