mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
filling in more ec2 specs
This commit is contained in:
parent
41e9724c1a
commit
b010bbf38b
8 changed files with 40 additions and 16 deletions
|
@ -12,7 +12,7 @@ module Fog
|
|||
def create_snapshot(volume_id)
|
||||
request({
|
||||
'Action' => 'CreateSnapshot',
|
||||
'VolumeId' => 'VolumeId'
|
||||
'VolumeId' => volume_id
|
||||
}, Fog::Parsers::AWS::EC2::CreateSnapshot.new)
|
||||
end
|
||||
|
||||
|
|
|
@ -2,12 +2,23 @@ require File.dirname(__FILE__) + '/../../spec_helper'
|
|||
|
||||
describe 'EC2.create_snapshot' do
|
||||
|
||||
it "should return proper attributes with no params" do
|
||||
pending
|
||||
# actual = ec2.create_snapshot(volume_id)
|
||||
# p actual
|
||||
before(:all) do
|
||||
@volume_id = ec2.create_volume('us-east-1a', 1).body[:volume_id]
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
ec2.delete_volume(@volume_id)
|
||||
ec2.delete_snapshot(@snapshot_id)
|
||||
end
|
||||
|
||||
it "should return proper attributes" do
|
||||
actual = ec2.create_snapshot(@volume_id)
|
||||
actual.body[:progress].should be_a(String)
|
||||
@snapshot_id = actual.body[:snapshot_id]
|
||||
actual.body[:snapshot_id].should be_a(String)
|
||||
actual.body[:start_time].should be_a(Time)
|
||||
actual.body[:status].should be_a(String)
|
||||
actual.body[:volume_id].should be_a(String)
|
||||
end
|
||||
|
||||
it "should return proper attributes with params"
|
||||
|
||||
end
|
||||
|
|
|
@ -2,12 +2,21 @@ require File.dirname(__FILE__) + '/../../spec_helper'
|
|||
|
||||
describe 'EC2.delete_snapshot' do
|
||||
|
||||
it "should return proper attributes with no params" do
|
||||
pending
|
||||
# actual = ec2.delete_snapshot(snapshot_id)
|
||||
# p actual
|
||||
before(:all) do
|
||||
@volume_id = ec2.create_volume('us-east-1a', 1).body[:volume_id]
|
||||
@snapshot_id = ec2.create_snapshot(@volume_id).body[:snapshot_id]
|
||||
end
|
||||
|
||||
after(:all) do
|
||||
ec2.delete_volume(@volume_id)
|
||||
end
|
||||
|
||||
it "should return proper attributes" do
|
||||
eventually do
|
||||
actual = ec2.delete_snapshot(@snapshot_id)
|
||||
actual.body[:request_id].should be_a(String)
|
||||
[false, true].should include(actual.body[:return])
|
||||
end
|
||||
end
|
||||
|
||||
it "should return proper attributes with params"
|
||||
|
||||
end
|
||||
|
|
|
@ -4,6 +4,8 @@ describe 'EC2.describe_key_pairs' do
|
|||
|
||||
it "should return proper attributes with no params" do
|
||||
actual = ec2.describe_key_pairs
|
||||
actual.body[:key_set].should be_an(Array)
|
||||
actual.body[:request_id].should be_a(String)
|
||||
p actual
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ describe 'EC2.describe_security_groups' do
|
|||
|
||||
it "should return proper attributes with no params" do
|
||||
actual = ec2.describe_security_groups
|
||||
actual.security_group_info.should be_an(Array)
|
||||
p actual
|
||||
end
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
|
|||
describe 'EC2.run_instances' do
|
||||
|
||||
it "should return proper attributes" do
|
||||
pending
|
||||
actual = ec2.run_instances('ami-5ee70037', 1, 1)
|
||||
p actual
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ describe "should eventually { block }" do
|
|||
end
|
||||
|
||||
it "should pass if block returns true after a delay" do
|
||||
eventually = Eventually.new(true, 1)
|
||||
eventually = EventualMock.new(true, 1)
|
||||
lambda { true }.should eventually { |expected| expected.should == eventually.test }
|
||||
end
|
||||
|
||||
|
@ -26,7 +26,7 @@ describe "should_not eventually { block }" do
|
|||
end
|
||||
|
||||
it "should pass if block returns false after a delay" do
|
||||
eventually = Eventually.new(false, 1)
|
||||
eventually = EventualMock.new(false, 1)
|
||||
lambda { true }.should_not eventually { |expected| expected.should_not == eventually.test }
|
||||
end
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ def s3
|
|||
end
|
||||
end
|
||||
|
||||
class Eventually
|
||||
class EventualMock
|
||||
def initialize(result, delay)
|
||||
@result = result
|
||||
@delay = delay
|
||||
|
|
Loading…
Add table
Reference in a new issue