mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
spec snapshot failure cases
This commit is contained in:
parent
644f734a1c
commit
1e4c61c265
3 changed files with 60 additions and 32 deletions
|
@ -1,6 +1,7 @@
|
|||
require File.dirname(__FILE__) + '/../../../spec_helper'
|
||||
|
||||
describe 'EC2.create_snapshot' do
|
||||
describe "success" do
|
||||
|
||||
before(:all) do
|
||||
@volume_id = ec2.create_volume('us-east-1a', 1).body['volumeId']
|
||||
|
@ -23,4 +24,14 @@ describe 'EC2.create_snapshot' do
|
|||
actual.body['volumeId'].should be_a(String)
|
||||
end
|
||||
|
||||
end
|
||||
describe "failure" do
|
||||
|
||||
it "should raise a BadRequest error if the volume does not exist" do
|
||||
lambda {
|
||||
ec2.create_snapshot('vol-00000000')
|
||||
}.should raise_error(Fog::Errors::BadRequest)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require File.dirname(__FILE__) + '/../../../spec_helper'
|
||||
|
||||
describe 'EC2.delete_snapshot' do
|
||||
describe 'success' do
|
||||
|
||||
before(:all) do
|
||||
@volume_id = ec2.create_volume('us-east-1a', 1).body['volumeId']
|
||||
|
@ -21,4 +22,14 @@ describe 'EC2.delete_snapshot' do
|
|||
end
|
||||
end
|
||||
|
||||
end
|
||||
describe 'failure' do
|
||||
|
||||
it "should raise a BadRequest error if snapshot does not exist" do
|
||||
lambda {
|
||||
ec2.release_address('snap-00000000')
|
||||
}.should raise_error(Fog::Errors::BadRequest)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -40,4 +40,10 @@ describe 'EC2.describe_snapshots' do
|
|||
end
|
||||
end
|
||||
|
||||
it "should raise a BadRequest error if the snapshot does not exist" do
|
||||
lambda {
|
||||
ec2.describe_snapshots('snap-00000000')
|
||||
}.should raise_error(Fog::Errors::BadRequest)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue