Sha256: d012e704a03b139db21f7c2a9eafe41b130a0e7a4d5247b13bce05aca6a5e90c

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

# Volume requests are actually slow enough to occasionally not work
# Use sleep statements to manage that
describe Docker::Volume, :docker_1_9 do
  let(:name) { "ArbitraryNameForTheRakeTestVolume" }

  describe '.create' do
    let(:volume) { Docker::Volume.create(name) }

    after { volume.remove }

    it 'creates a volume' do
      expect(volume.id).to eq(name)
    end
  end

  describe '.get' do
    let(:volume) { Docker::Volume.get(name) }

    before { Docker::Volume.create(name); sleep 1 }
    after { volume.remove }

    it 'gets volume details' do
      expect(volume.id).to eq(name)
      expect(volume.info).to_not be_empty
    end
  end

  describe '.all' do
    after { Docker::Volume.get(name).remove }

    it 'gets a list of volumes' do
      expect { Docker::Volume.create(name); sleep 1 }.to change { Docker::Volume.all.length }.by(1)
    end
  end

  describe '#remove' do
    it 'removes a volume' do
      volume = Docker::Volume.create(name)
      sleep 1
      expect { volume.remove }.to change { Docker::Volume.all.length }.by(-1)
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
docker-api-1.31.0 spec/docker/volume_spec.rb
docker-api-1.30.2 spec/docker/volume_spec.rb
docker-api-1.30.1 spec/docker/volume_spec.rb
docker-api-1.30.0 spec/docker/volume_spec.rb
docker-api-1.29.2 spec/docker/volume_spec.rb
docker-api-1.29.1 spec/docker/volume_spec.rb
docker-api-1.29.0 spec/docker/volume_spec.rb
docker-api-1.28.0 spec/docker/volume_spec.rb
docker-api-1.27.0 spec/docker/volume_spec.rb