Sha256: 16b56880675c7160ae23abd754e9e74a5fe6226c13dd6b0274ec6ac7d297e8f7

Contents?: true

Size: 1.38 KB

Versions: 74

Compression:

Stored size: 1.38 KB

Contents

Shindo.tests('Fog::Rackspace::BlockStorage | volume_tests', ['rackspace']) do

  volume_format = {
    'id' => String,
    'status' => String,
    'display_name' => Fog::Nullable::String,
    'display_description' => Fog::Nullable::String,
    'size' => Integer,
    'created_at' => String,
    'volume_type' => String,
    'availability_zone' => String,
    'snapshot_id' => Fog::Nullable::String,
    'attachments' => Array,
    'metadata' => Hash
  }

  get_volume_format = {
    'volume' => volume_format
  }

  list_volume_format = {
    'volumes' => [volume_format]
  }

  service = Fog::Rackspace::BlockStorage.new

  tests('success') do
    id = nil
    size = 100

    tests("#create_volume(#{size})").formats(get_volume_format) do
      data = service.create_volume(size).body
      id = data['volume']['id']
      data
    end

    tests("#list_volumes").formats(list_volume_format) do
      service.list_volumes.body
    end

    tests("#get_volume(#{id})").formats(get_volume_format) do
      service.get_volume(id).body
    end

    tests("#delete_volume(#{id})").succeeds do
      service.delete_volume(id)
    end
  end

  tests('failure') do
    tests("#create_volume(-1)").raises(Fog::Rackspace::BlockStorage::BadRequest) do
      service.create_volume(-1)
    end

    tests("#get_volume(-1)").raises(Fog::Rackspace::BlockStorage::NotFound) do
      service.get_volume(-1)
    end
  end
end

Version data entries

74 entries across 74 versions & 8 rubygems

Version Path
fog-maestrodev-1.19.0.20140109202555 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/rackspace/requests/block_storage/volume_tests.rb
fog-1.19.0 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131209090811 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131206115947 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131126122111 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131125111730 tests/rackspace/requests/block_storage/volume_tests.rb
fog-maestrodev-1.18.0.20131125083406 tests/rackspace/requests/block_storage/volume_tests.rb