Sha256: 057de018270f6c1d0f35ded8856c31e0d93147e77f88615ebf8f50f20eb0ab19
Contents?: true
Size: 1.3 KB
Versions: 8
Compression:
Stored size: 1.3 KB
Contents
require 'vagrant-deltacloud-provider/spec_helper' describe VagrantPlugins::Deltacloud::Command::HardwareProfileList do describe 'cmd' do let(:deltacloud) do double('deltacloud').tap do |deltacloud| deltacloud.stub(:list_hardware_profiles) do [ HardwareProfile.new('1', 'XS', '1', '512', '10'), HardwareProfile.new('2', 'S', '1', '2048', '20') ] end end end let(:env) do Hash.new.tap do |env| env[:ui] = double('ui') env[:ui].stub(:info).with(anything) env.stub(:deltacloud_client) { deltacloud } end end before :each do @hardware_profile_list_cmd = VagrantPlugins::Deltacloud::Command::HardwareProfileList.new(nil, env) end it 'prints hardware profile list from server' do deltacloud.should_receive(:list_hardware_profiles).with(env) expect(env[:ui]).to receive(:info).with(' +-----+-------+------+----------+----------------+ | Id | Name | vCPU | RAM (Mo) | Disk size (Go) | +-----+-------+------+----------+----------------+ | 1 | XS | 1 | 512 | 10 | | 2 | S | 1 | 2048 | 20 | +-----+-------+------+----------+----------------+') @hardware_profile_list_cmd.cmd('hardware-profile-list', [], env) end end end
Version data entries
8 entries across 8 versions & 1 rubygems