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:
parent
302a5638a8
commit
01ab1e7d01
3 changed files with 14 additions and 5 deletions
|
@ -11,6 +11,13 @@ module Fog
|
||||||
@addresses
|
@addresses
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def initialize(new_attributes = {})
|
||||||
|
new_attributes = {
|
||||||
|
:instance_id => ''
|
||||||
|
}.merge!(new_attributes)
|
||||||
|
super(new_attributes)
|
||||||
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
connection.release_address(@public_ip)
|
connection.release_address(@public_ip)
|
||||||
true
|
true
|
||||||
|
|
|
@ -32,7 +32,9 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(public_ip)
|
def get(public_ip)
|
||||||
all(:public_ip => public_ip).first
|
all(public_ip).first
|
||||||
|
rescue Fog::Errors::BadRequest
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
|
@ -5,7 +5,7 @@ describe 'Fog::AWS::EC2::Addresses' do
|
||||||
describe "#all" do
|
describe "#all" do
|
||||||
|
|
||||||
it "should return a Fog::AWS::EC2::Addresses" 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
|
end
|
||||||
|
|
||||||
it "should include persisted addresses" do
|
it "should include persisted addresses" do
|
||||||
|
@ -31,7 +31,7 @@ describe 'Fog::AWS::EC2::Addresses' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should exist on ec2" do
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -54,7 +54,7 @@ describe 'Fog::AWS::EC2::Addresses' do
|
||||||
describe "#new" do
|
describe "#new" do
|
||||||
|
|
||||||
it "should return a Fog::AWS::EC2::Address" 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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -62,7 +62,7 @@ describe 'Fog::AWS::EC2::Addresses' do
|
||||||
describe "#reload" do
|
describe "#reload" do
|
||||||
|
|
||||||
it "should return a Fog::AWS::EC2::Addresses" 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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue