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

proper errors for existing ec2 mocks

This commit is contained in:
Wesley Beary 2009-08-16 21:37:18 -07:00
parent dae13d496c
commit 068cccf394
4 changed files with 14 additions and 0 deletions

View file

@ -43,6 +43,7 @@ else
} }
else else
response.status = 400 response.status = 400
raise(Fog::Errors.status_error(200, 400, response))
end end
response response
end end

View file

@ -38,6 +38,7 @@ else
} }
else else
response.status = 400 response.status = 400
raise(Fog::Errors.status_error(200, 400, response))
end end
response response
end end

View file

@ -13,4 +13,10 @@ describe 'EC2.create_volume' do
actual.body['return'].should == true actual.body['return'].should == true
end end
it "should raise a BadRequest error if volume does not exist" do
lambda {
@ec2.release_address('vol-00000000')
}.should raise_error(Fog::Errors::BadRequest)
end
end end

View file

@ -13,4 +13,10 @@ describe 'EC2.release_address' do
actual.body['return'].should == true actual.body['return'].should == true
end end
it "should raise a BadRequest error if address does not exist" do
lambda {
@ec2.release_address('0.0.0.0')
}.should raise_error(Fog::Errors::BadRequest)
end
end end