Sha256: acb48556cded4bb9d1e3ba1adb23afa7ab6949b61e348d64d5f42e60da0808a5
Contents?: true
Size: 1.74 KB
Versions: 1
Compression:
Stored size: 1.74 KB
Contents
require 'spec_helper' describe Squall::IpAddressJoin do before(:each) do @join = Squall::IpAddressJoin.new end describe "#list" do use_vcr_cassette 'ipaddress_join/list' it "requires virtual machine ID" do expect { @join.list }.to raise_error(ArgumentError) end it "raises NotFound with an invalid virtual machine ID" do expect { @join.list(404) }.to raise_error(Squall::NotFound) end it "returns list of ip_addresses" do ips = @join.list(1) ips.should be_an(Array) end it "contains IP address data" do ips = @join.list(1) ips.all?.should be_true end end describe "#assign" do use_vcr_cassette "ipaddress_join/assign" it "raises ArgumentError without required arguments" do expect { @join.assign }.to raise_error(ArgumentError) expect { @join.assign(1) }.to raise_error(ArgumentError) end it "raises NotFound with an invalid virtual machine ID" do expect { @join.assign(404, {:ip_address_id => 1, :network_interface_id => 1}) }.to raise_error(Squall::NotFound) end it "assigns the IP join" do join = @join.assign(1, {:ip_address_id => 1, :network_interface_id => 1}) @join.success.should be_true end end describe "#delete" do use_vcr_cassette "ipaddress_join/delete" it "raises ArgumentError without required arguments" do expect { @join.delete }.to raise_error(ArgumentError) expect { @join.delete(1) }.to raise_error(ArgumentError) end it "raises NotFound with an invalid ID" do expect { @join.delete(404, 1) }.to raise_error(Squall::NotFound) end it "deletes the IP join" do @join.delete(1, 1) @join.success.should be_true end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
squall-1.1.0 | spec/squall/ip_address_join_spec.rb |