Sha256: dec550eb45551af18428867c6332cff3b3a5ed851c735965fe07da31b76e36fc
Contents?: true
Size: 1.81 KB
Versions: 3
Compression:
Stored size: 1.81 KB
Contents
require 'spec_helper' describe ProfitBricks::LAN do before(:all) do @datacenter = ProfitBricks::Datacenter.create(options[:datacenter]) @datacenter.wait_for { ready? } @server = ProfitBricks::Server.create(@datacenter.id, options[:server]) @server.wait_for { ready? } @lan = ProfitBricks::LAN.create(@datacenter.id, options[:lan]) @lan.wait_for { ready? } @nic = ProfitBricks::NIC.create(@datacenter.id, @server.id, lan: @lan.id) @nic.wait_for { ready? } end after(:all) do @datacenter.delete end it '#create' do expect(@lan.type).to eq('lan') expect(@lan.id).to match(/^\d+$/) expect(@lan.properties['name']).to eq('public Lan 4') expect(@lan.properties['public']).to be true end it '#list' do lans = ProfitBricks::LAN.list(@datacenter.id) expect(lans.count).to be > 0 expect(lans[0].type).to eq('lan') expect(lans[0].id).to match(/^\d+$/) expect(lans[0].properties['name']).to eq('public Lan 4') expect(lans[0].properties['public']).to be true end it '#get' do lan = ProfitBricks::LAN.get(@datacenter.id, @lan.id) expect(lan.type).to eq('lan') expect(lan.id).to eq(@lan.id) expect(lan.properties['name']).to eq('public Lan 4') expect(lan.properties['public']).to be true end it '#update' do lan = @lan.update(public: 'false') expect(lan.type).to eq('lan') expect(lan.id).to eq(@lan.id) expect(lan.properties['name']).to eq('public Lan 4') expect(lan.properties['public']).to be false end it '#delete' do lan = ProfitBricks::LAN.create(@datacenter.id, options[:lan]) lan.wait_for { ready? } expect(lan.delete).to be_kind_of(Hash) end it '#list_members' do members = @lan.list_members expect(members.count).to be > 0 expect(members[0].type).to eq('nic') end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
profitbricks-sdk-ruby-1.0.4 | spec/lan_spec.rb |
profitbricks-sdk-ruby-1.0.3 | spec/lan_spec.rb |
profitbricks-sdk-ruby-1.0.2 | spec/lan_spec.rb |