Sha256: 44fc55a298d1051c278e1572be9b7ebe36239793ee2c2e8644c6f06c40b41b14

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

Shindo.tests('Fog::Storage[:ibm] | volume', ['ibm']) do

  tests('success') do

    @volume       = nil
    @volume_id    = nil
    @name         = "fog test volume"
    @format       = "RAW"
    @location_id  = "41"
    @size         = "256"
    @offering_id  = "20001208"

    tests('Fog::Storage::IBM::Volume.new') do
      @volume = Fog::Storage[:ibm].volumes.new(
        :name           => @name,
        :format         => @format,
        :location_id    => @location_id,
        :size           => @size,
        :offering_id    => @offering_id
      )
      returns(@name) { @volume.name }
    end

    tests('Fog::Storage::IBM::Volume#save') do
      returns(true)   { @volume.save }
      returns(String) { @volume.id.class }
      @volume.wait_for(Fog::IBM::TIMEOUT) { ready? }
      @volume_id = @volume.id
    end

    tests("Fog::Storage::IBM::Volume#instance") do
      returns(nil) { @volume.instance }
    end

    tests("Fog::Storage::IBM::Volume#location_id") do
      returns(String) { @volume.location_id.class }
    end

    tests('Fog::Storage::IBM::Volume#id') do
      returns(@volume_id) { @volume.id }
    end

    tests('Fog::Storage::IBM::Volume#ready?') do
      # We do a "get" to advance the state if we are mocked.
      # TODO: Fix this for real connections
      Fog::Storage[:ibm].get_volume(@volume_id)
      returns(true) { @volume.ready? }
    end

    tests('Fog::Storage::IBM::Volume#status') do
      returns("Detached") { @volume.status }
    end

    tests('Fog::Storage::IBM::Volume#destroy') do
      returns(true) { @volume.destroy }
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-1.3.0 tests/ibm/models/storage/volume_tests.rb