Sha256: 8ea4575f634a63ef7e4af301571588e9e6f5560b59449c244fbb37d2b0358db2

Contents?: true

Size: 1.43 KB

Versions: 9

Compression:

Stored size: 1.43 KB

Contents

require 'vagrant-openstack-provider/spec_helper'

describe VagrantPlugins::Openstack::Command::VolumeList do
  describe 'cmd' do
    let(:cinder) do
      double('cinder').tap do |cinder|
        cinder.stub(:get_all_volumes) do
          [Volume.new('987', 'vol-01', '2', 'available', 'true', nil, nil),
           Volume.new('654', 'vol-02', '4', 'in-use', 'false', 'inst-01', '/dev/vdc')]
        end
      end
    end

    let(:env) do
      {}.tap do |env|
        env[:ui] = double('ui')
        env[:ui].stub(:info).with(anything)
        env[:openstack_client] = double
        env[:openstack_client].stub(:cinder) { cinder }
      end
    end

    before :each do
      @volume_list_cmd = VagrantPlugins::Openstack::Command::VolumeList.new(nil, env)
    end

    it 'prints volumes list from server' do
      cinder.should_receive(:get_all_volumes).with(env)
      expect(env[:ui]).to receive(:info).with('
+-----+--------+-----------+-----------+-------------------------------------+
| ID  | Name   | Size (Go) | Status    | Attachment (instance ID and device) |
+-----+--------+-----------+-----------+-------------------------------------+
| 987 | vol-01 | 2         | available |                                     |
| 654 | vol-02 | 4         | in-use    | inst-01 (/dev/vdc)                  |
+-----+--------+-----------+-----------+-------------------------------------+')

      @volume_list_cmd.cmd('volume-list', [], env)
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
vagrant-openstack-provider-0.13.0 spec/vagrant-openstack-provider/command/volume_list_spec.rb
vagrant-openstack-provider-0.12.0 spec/vagrant-openstack-provider/command/volume_list_spec.rb
vagrant-openstack-provider-illuin-0.11.1 spec/vagrant-openstack-provider/command/volume_list_spec.rb
vagrant-openstack-provider-0.11.0 spec/vagrant-openstack-provider/command/volume_list_spec.rb
vagrant-openstack-provider-0.10.0 spec/vagrant-openstack-provider/command/volume_list_spec.rb
vagrant-openstack-provider-0.9.0 spec/vagrant-openstack-provider/command/volume_list_spec.rb
vagrant-openstack-provider-0.8.0 spec/vagrant-openstack-provider/command/volume_list_spec.rb
vagrant-openstack-provider-0.7.2 spec/vagrant-openstack-provider/command/volume_list_spec.rb
vagrant-openstack-provider-0.7.1 spec/vagrant-openstack-provider/command/volume_list_spec.rb