Sha256: d898e3614780829c74461f6f3208dcabb8ed42bcd37697f551e105d6319de604
Contents?: true
Size: 1.21 KB
Versions: 6
Compression:
Stored size: 1.21 KB
Contents
require 'vagrant-conoha/spec_helper' describe VagrantPlugins::ConoHa::Command::FlavorList do describe 'cmd' do let(:nova) do double('nova').tap do |nova| nova.stub(:get_all_flavors) do [ Flavor.new('001', 'small', '1', '1024', '10'), Flavor.new('002', 'large', '4', '4096', '100') ] 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(:nova) { nova } end end before :each do @flavor_list_cmd = VagrantPlugins::ConoHa::Command::FlavorList.new(nil, env) end it 'prints flovor list from server' do nova.should_receive(:get_all_flavors).with(env) expect(env[:ui]).to receive(:info).with(' +-----+-------+------+----------+----------------+ | Id | Name | vCPU | RAM (Mo) | Disk size (Go) | +-----+-------+------+----------+----------------+ | 001 | small | 1 | 1024 | 10 | | 002 | large | 4 | 4096 | 100 | +-----+-------+------+----------+----------------+') @flavor_list_cmd.cmd('flavor-list', [], env) end end end
Version data entries
6 entries across 6 versions & 1 rubygems