1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

allow calling describe addresses with no params

This commit is contained in:
Wesley Beary 2009-07-02 11:10:15 -07:00
parent 7a9039da9c
commit fd814791ba
2 changed files with 9 additions and 2 deletions

View file

@ -46,7 +46,7 @@ module Fog
}, Fog::Parsers::AWS::EC2::AllocateAddress.new)
end
def describe_addresses(public_ips)
def describe_addresses(public_ips = [])
params, index = {}, 1
for public_ip in [*public_ips]
params["PublicIp.#{index}"] = public_ip

View file

@ -10,7 +10,14 @@ describe 'EC2.describe_addresses' do
ec2.release_address(@public_ip)
end
it "should return proper attributes" do
it "should return proper attributes with no params" do
actual = ec2.describe_addresses
actual.body[:request_id].should be_a(String)
item = actual.body[:addresses].select {|address| address[:public_ip] == @public_ip}
item.should_not be_nil
end
it "should return proper attributes for specific ip" do
actual = ec2.describe_addresses(@public_ip)
actual.body[:request_id].should be_a(String)
item = actual.body[:addresses].select {|address| address[:public_ip] == @public_ip}