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

ec2 model spec fixes

This commit is contained in:
Wesley Beary 2009-09-22 22:47:45 -07:00
parent 302a5638a8
commit 01ab1e7d01
3 changed files with 14 additions and 5 deletions

View file

@ -11,6 +11,13 @@ module Fog
@addresses
end
def initialize(new_attributes = {})
new_attributes = {
:instance_id => ''
}.merge!(new_attributes)
super(new_attributes)
end
def destroy
connection.release_address(@public_ip)
true

View file

@ -32,7 +32,9 @@ module Fog
end
def get(public_ip)
all(:public_ip => public_ip).first
all(public_ip).first
rescue Fog::Errors::BadRequest
nil
end
def new

View file

@ -5,7 +5,7 @@ describe 'Fog::AWS::EC2::Addresses' do
describe "#all" do
it "should return a Fog::AWS::EC2::Addresses" do
s3.buckets.all.should be_a(Fog::AWS::S3::Addresses)
ec2.addresses.all.should be_a(Fog::AWS::EC2::Addresses)
end
it "should include persisted addresses" do
@ -31,7 +31,7 @@ describe 'Fog::AWS::EC2::Addresses' do
end
it "should exist on ec2" do
ec2.addresses.get(@public_ip).should_not be_nil
ec2.addresses.get(@address.public_ip).should_not be_nil
end
end
@ -54,7 +54,7 @@ describe 'Fog::AWS::EC2::Addresses' do
describe "#new" do
it "should return a Fog::AWS::EC2::Address" do
s3.buckets.new.should be_a(Fog::AWS::EC2::Address)
ec2.addresses.new.should be_a(Fog::AWS::EC2::Address)
end
end
@ -62,7 +62,7 @@ describe 'Fog::AWS::EC2::Addresses' do
describe "#reload" do
it "should return a Fog::AWS::EC2::Addresses" do
s3.buckets.all.should be_a(Fog::AWS::EC2::Addresses)
ec2.addresses.all.reload.should be_a(Fog::AWS::EC2::Addresses)
end
end