Sha256: cfe4d6ab93e5f64c448075f03f86d8ae77b71da9a82fe6bf330645724d4ec74a

Contents?: true

Size: 1.33 KB

Versions: 5

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

describe ProfitBricks::IPBlock do
  before(:all) do
    @ipblock = ProfitBricks::IPBlock.reserve(options[:ipblock])
  end

  after(:all) do
    @ipblock.release
  end

  # alias: create
  it '#reserve' do
    expect(@ipblock.type).to eq('ipblock')
    expect(@ipblock.id).to match(options[:uuid])
    expect(@ipblock.properties['ips'].count).to be > 0
    expect(@ipblock.properties['location']).to eq('de/fra')
    expect(@ipblock.properties['size']).to eq(1)
  end

  it '#list' do
    ipblocks = ProfitBricks::IPBlock.list

    expect(ipblocks.count).to be > 0
    expect(ipblocks[0].type).to eq('ipblock')
    expect(ipblocks[0].id).to match(options[:uuid])
    expect(ipblocks[0].properties['ips'].count).to be > 0
    expect(ipblocks[0].properties['location']).to eq('de/fra')
    expect(ipblocks[0].properties['size']).to be_kind_of(Integer)
  end

  it '#get' do
    ipblock = ProfitBricks::IPBlock.get(@ipblock.id)

    expect(ipblock.type).to eq('ipblock')
    expect(ipblock.id).to eq(@ipblock.id)
    expect(ipblock.properties['ips'].count).to be > 0
    expect(ipblock.properties['location']).to eq('de/fra')
    expect(ipblock.properties['size']).to eq(1)
  end

  # alias: delete
  it '#release' do
    ipblock = ProfitBricks::IPBlock.reserve(options[:ipblock])

    expect(ipblock.release).to be_kind_of(Hash)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
profitbricks-sdk-ruby-3.0.2 spec/ipblock_spec.rb
profitbricks-sdk-ruby-3.0.1 spec/ipblock_spec.rb
profitbricks-sdk-ruby-3.0.0 spec/ipblock_spec.rb
profitbricks-sdk-ruby-1.1.0 spec/ipblock_spec.rb
profitbricks-sdk-ruby-1.0.5 spec/ipblock_spec.rb