Sha256: d925bf25569596c71e26f5d437e610fb69b552c629a785cd10f91e80e9d742c1
Contents?: true
Size: 1.65 KB
Versions: 1
Compression:
Stored size: 1.65 KB
Contents
require 'vagrant-openstack-illuin-provider/spec_helper' describe VagrantPlugins::Openstack::Command::NetworkList do describe 'cmd' do let(:neutron) do double('neutron').tap do |neutron| neutron.stub(:get_private_networks) do [ Item.new('net-01', 'internal'), Item.new('net-02', 'external') ] end neutron.stub(:get_all_networks) do [ Item.new('pub-01', 'public'), Item.new('net-01', 'internal'), Item.new('net-02', 'external') ] 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(:neutron) { neutron } end end before :each do @network_list_cmd = VagrantPlugins::Openstack::Command::NetworkList.new(nil, env) end it 'prints network list from server' do neutron.should_receive(:get_private_networks).with(env) expect(env[:ui]).to receive(:info).with(' +--------+----------+ | ID | Name | +--------+----------+ | net-01 | internal | | net-02 | external | +--------+----------+') @network_list_cmd.cmd('network-list', [], env) end it 'prints all networks list from server' do neutron.should_receive(:get_all_networks).with(env) expect(env[:ui]).to receive(:info).with(' +--------+----------+ | ID | Name | +--------+----------+ | pub-01 | public | | net-01 | internal | | net-02 | external | +--------+----------+') @network_list_cmd.cmd('network-list', ['all'], env) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vagrant-openstack-illuin-provider-0.12.0 | spec/vagrant-openstack-illuin-provider/command/network_list_spec.rb |