Sha256: 75b552d4a8edf7f9b2b9f6300f15b9835573aa75fa3ba8567a89cad1ff7584ce

Contents?: true

Size: 861 Bytes

Versions: 3

Compression:

Stored size: 861 Bytes

Contents

def snapshot_tests(connection, params, mocks_implemented = true)
  model_tests(connection.snapshots, params[:snapshot_attributes], mocks_implemented) do
    if !Fog.mocking? || mocks_implemented
      @instance.wait_for { ready? }
    end

    @volume = @instance.connection.volumes.create(params[:volumes_attributes])
    @volume.wait_for { ready? }

    tests('create').succeeds do
      @instance.create :volume_id => @volume.id
    end

    tests('destroy').succeeds do
      @instance.destroy
    end

    @volume.destroy
  end
end

Shindo.tests("Fog::Compute[:cloudstack] | snapshot", "cloudstack") do

  config = compute_providers[:cloudstack]

  snapshot_tests(Fog::Compute[:cloudstack], config, config[:mocked]) do
    if Fog.mocking? && !mocks_implemented
      pending
    else
      responds_to(:ready?)
      responds_to(:volume)
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/tests/cloudstack/compute/models/snapshot_tests.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/tests/cloudstack/compute/models/snapshot_tests.rb
fog-1.10.1 tests/cloudstack/compute/models/snapshot_tests.rb