Sha256: a6a6d49a64e974a5bb97521987588c0b77a35b085fc64b2eacf65147d1f321c8

Contents?: true

Size: 1.35 KB

Versions: 11

Compression:

Stored size: 1.35 KB

Contents

Shindo.tests('Fog::Compute::RackspaceV2 | metadata', ['rackspace']) do

  pending if Fog.mocking?

  service = Fog::Compute::RackspaceV2.new
  test_time = Time.now.to_i.to_s
  
  tests('success') do
    begin
      @server = service.servers.create(:name => "fog_server_#{test_time}", 
      :flavor_id => rackspace_test_flavor_id(service),
      :image_id => rackspace_test_image_id(service))
      
      @server.wait_for { ready? }
      
      tests('server') do
        collection_tests(@server.metadata, {:key => 'my_key', :value => 'my_value'}) do
          @server.wait_for { ready? }
        end
      end
      
      tests('image') do
        @image = @server.create_image("fog_image_#{test_time}", :metadata => {:my_key => 'my_value'})
        @image.wait_for { ready? }
        tests("#all").succeeds do
          pending if Fog.mocking? && !mocks_implemented
          metadata = @image.metadata.all
          my_metadata = metadata.select {|datum| datum.key == 'my_key'}
          returns(1) { my_metadata.size }
          returns('my_value') {my_metadata[0].value } 
        end

        tests("#get('my_key')").returns('my_value') do
          pending if Fog.mocking? && !mocks_implemented
          @image.metadata.get('my_key').value     
        end        
      end
      
    ensure
      @image.destroy if @image
      @server.destroy if @server
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
gapinc-fog-1.12.1.2.1 tests/rackspace/models/compute_v2/metadata_tests.rb
fog-1.17.0 tests/rackspace/models/compute_v2/metadata_tests.rb
fog-1.16.0 tests/rackspace/models/compute_v2/metadata_tests.rb
fog-maestrodev-1.15.0.20130927082724 tests/rackspace/models/compute_v2/metadata_tests.rb
fog-maestrodev-1.15.0.20130829165835 tests/rackspace/models/compute_v2/metadata_tests.rb
fog-1.15.0 tests/rackspace/models/compute_v2/metadata_tests.rb
gapinc-fog-1.14.0 tests/rackspace/models/compute_v2/metadata_tests.rb
fog-maestrodev-1.14.0.20130806165225 tests/rackspace/models/compute_v2/metadata_tests.rb
fog-1.14.0 tests/rackspace/models/compute_v2/metadata_tests.rb
fog-1.13.0 tests/rackspace/models/compute_v2/metadata_tests.rb
gapinc-fog-1.12.1.2 tests/rackspace/models/compute_v2/metadata_tests.rb