Sha256: 5657d79313b91e6cd3a00cb7ad502453c6238a47d79f525d44f4b1af65c88661
Contents?: true
Size: 1.43 KB
Versions: 1
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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vagrant-openstack-provider-0.7.0 | spec/vagrant-openstack-provider/command/volume_list_spec.rb |