fog 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -0
- data/Rakefile +12 -0
- data/VERSION +1 -1
- data/bin/fog +28 -40
- data/fog.gemspec +16 -3
- data/lib/fog.rb +27 -3
- data/lib/fog/aws/ec2.rb +7 -3
- data/lib/fog/aws/models/ec2/security_group.rb +1 -1
- data/lib/fog/aws/models/ec2/server.rb +8 -3
- data/lib/fog/aws/models/ec2/servers.rb +1 -1
- data/lib/fog/aws/parsers/ec2/terminate_instances.rb +10 -10
- data/lib/fog/aws/requests/ec2/run_instances.rb +1 -1
- data/lib/fog/aws/s3.rb +6 -2
- data/lib/fog/rackspace.rb +8 -2
- data/lib/fog/slicehost.rb +3 -1
- data/spec/aws/models/ec2/address_spec.rb +8 -8
- data/spec/aws/models/ec2/addresses_spec.rb +10 -10
- data/spec/aws/models/ec2/key_pair_spec.rb +8 -8
- data/spec/aws/models/ec2/key_pairs_spec.rb +10 -10
- data/spec/aws/models/ec2/security_group_spec.rb +8 -8
- data/spec/aws/models/ec2/security_groups_spec.rb +10 -10
- data/spec/aws/models/ec2/server_spec.rb +1 -4
- data/spec/aws/models/ec2/servers_spec.rb +1 -1
- data/spec/aws/models/ec2/snapshot_spec.rb +12 -10
- data/spec/aws/models/ec2/snapshots_spec.rb +20 -20
- data/spec/aws/models/ec2/volume_spec.rb +10 -10
- data/spec/aws/models/ec2/volumes_spec.rb +10 -10
- data/spec/aws/models/s3/directories_spec.rb +8 -8
- data/spec/aws/models/s3/directory_spec.rb +11 -11
- data/spec/aws/models/s3/file_spec.rb +2 -2
- data/spec/aws/models/s3/files_spec.rb +2 -2
- data/spec/aws/requests/ec2/allocate_address_spec.rb +2 -2
- data/spec/aws/requests/ec2/associate_address_spec.rb +15 -13
- data/spec/aws/requests/ec2/attach_volume_spec.rb +12 -12
- data/spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb +3 -3
- data/spec/aws/requests/ec2/create_key_pair_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_security_group_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_snapshot_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_volume_spec.rb +2 -2
- data/spec/aws/requests/ec2/delete_key_pair_spec.rb +3 -3
- data/spec/aws/requests/ec2/delete_security_group_spec.rb +3 -3
- data/spec/aws/requests/ec2/delete_snapshot_spec.rb +5 -5
- data/spec/aws/requests/ec2/delete_volume_spec.rb +3 -3
- data/spec/aws/requests/ec2/describe_addresses_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_availability_zones_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_images_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_instances_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_key_pairs_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_regions_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_security_groups_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_snapshots_spec.rb +7 -7
- data/spec/aws/requests/ec2/describe_volumes_spec.rb +5 -5
- data/spec/aws/requests/ec2/detach_volume_spec.rb +7 -7
- data/spec/aws/requests/ec2/disassociate_address_spec.rb +9 -7
- data/spec/aws/requests/ec2/get_console_output_spec.rb +4 -4
- data/spec/aws/requests/ec2/reboot_instances_spec.rb +4 -4
- data/spec/aws/requests/ec2/release_address_spec.rb +3 -3
- data/spec/aws/requests/ec2/revoke_security_group_ingress_spec.rb +4 -4
- data/spec/aws/requests/ec2/run_instances_spec.rb +2 -2
- data/spec/aws/requests/ec2/terminate_instances_spec.rb +7 -7
- data/spec/aws/requests/s3/copy_object_spec.rb +11 -11
- data/spec/aws/requests/s3/delete_bucket_spec.rb +8 -8
- data/spec/aws/requests/s3/delete_object_spec.rb +8 -8
- data/spec/aws/requests/s3/get_bucket_location_spec.rb +4 -4
- data/spec/aws/requests/s3/get_bucket_spec.rb +12 -12
- data/spec/aws/requests/s3/get_object_spec.rb +9 -9
- data/spec/aws/requests/s3/get_request_payment_spec.rb +4 -4
- data/spec/aws/requests/s3/get_service_spec.rb +4 -4
- data/spec/aws/requests/s3/head_object_spec.rb +5 -5
- data/spec/aws/requests/s3/put_bucket_spec.rb +3 -3
- data/spec/aws/requests/s3/put_object_spec.rb +11 -11
- data/spec/aws/requests/s3/put_request_payment_spec.rb +4 -4
- data/spec/aws/requests/simpledb/batch_put_attributes_spec.rb +4 -4
- data/spec/aws/requests/simpledb/create_domain_spec.rb +4 -4
- data/spec/aws/requests/simpledb/delete_attributes_spec.rb +8 -8
- data/spec/aws/requests/simpledb/delete_domain_spec.rb +3 -3
- data/spec/aws/requests/simpledb/domain_metadata_spec.rb +6 -6
- data/spec/aws/requests/simpledb/get_attributes_spec.rb +9 -9
- data/spec/aws/requests/simpledb/list_domains_spec.rb +4 -4
- data/spec/aws/requests/simpledb/put_attributes_spec.rb +4 -4
- data/spec/compact_progress_bar_formatter.rb +195 -0
- data/spec/rackspace/models/servers/server_spec.rb +1 -1
- data/spec/rackspace/requests/files/delete_container_spec.rb +3 -3
- data/spec/rackspace/requests/files/delete_object_spec.rb +8 -8
- data/spec/rackspace/requests/files/get_container_spec.rb +6 -6
- data/spec/rackspace/requests/files/get_containers_spec.rb +3 -3
- data/spec/rackspace/requests/files/head_container_spec.rb +6 -6
- data/spec/rackspace/requests/files/head_containers_spec.rb +3 -3
- data/spec/rackspace/requests/files/put_container_spec.rb +2 -2
- data/spec/rackspace/requests/files/put_object_spec.rb +4 -4
- data/spec/rackspace/requests/servers/create_image_spec.rb +4 -4
- data/spec/rackspace/requests/servers/create_server_spec.rb +2 -2
- data/spec/rackspace/requests/servers/delete_image_spec.rb +5 -5
- data/spec/rackspace/requests/servers/delete_server_spec.rb +3 -3
- data/spec/rackspace/requests/servers/get_flavor_details_spec.rb +1 -1
- data/spec/rackspace/requests/servers/get_server_details_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_flavors_detail_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_flavors_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_images_detail_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_images_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_private_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_public_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_servers_detail_spec.rb +3 -3
- data/spec/rackspace/requests/servers/list_servers_spec.rb +3 -3
- data/spec/rackspace/requests/servers/reboot_server_spec.rb +4 -4
- data/spec/rackspace/requests/servers/update_server_spec.rb +4 -4
- data/spec/slicehost/requests/create_slice_spec.rb +2 -2
- data/spec/slicehost/requests/delete_slice_spec.rb +2 -2
- data/spec/slicehost/requests/get_backups_spec.rb +1 -1
- data/spec/slicehost/requests/get_flavors_spec.rb +1 -1
- data/spec/slicehost/requests/get_images_spec.rb +1 -1
- data/spec/slicehost/requests/get_slices_spec.rb +1 -1
- data/spec/spec_helper.rb +60 -38
- metadata +16 -3
- data/spec/spec.opts +0 -1
@@ -5,7 +5,7 @@ describe 'Fog::AWS::EC2::Address' do
|
|
5
5
|
describe "#initialize" do
|
6
6
|
|
7
7
|
it "should remap attributes from parser" do
|
8
|
-
address = ec2.addresses.new(
|
8
|
+
address = AWS[:ec2].addresses.new(
|
9
9
|
'instanceId' => 'i-00000000',
|
10
10
|
'publicIp' => '0.0.0.0'
|
11
11
|
)
|
@@ -18,11 +18,11 @@ describe 'Fog::AWS::EC2::Address' do
|
|
18
18
|
describe "#addresses" do
|
19
19
|
|
20
20
|
it "should return a Fog::AWS::EC2::Addresses" do
|
21
|
-
ec2.addresses.new.collection.should be_a(Fog::AWS::EC2::Addresses)
|
21
|
+
AWS[:ec2].addresses.new.collection.should be_a(Fog::AWS::EC2::Addresses)
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should be the addresses the address is related to" do
|
25
|
-
addresses = ec2.addresses
|
25
|
+
addresses = AWS[:ec2].addresses
|
26
26
|
addresses.new.collection.should == addresses
|
27
27
|
end
|
28
28
|
|
@@ -31,7 +31,7 @@ describe 'Fog::AWS::EC2::Address' do
|
|
31
31
|
describe "#destroy" do
|
32
32
|
|
33
33
|
it "should return true if the address is deleted" do
|
34
|
-
address = ec2.addresses.create
|
34
|
+
address = AWS[:ec2].addresses.create
|
35
35
|
address.destroy.should be_true
|
36
36
|
end
|
37
37
|
|
@@ -39,8 +39,8 @@ describe 'Fog::AWS::EC2::Address' do
|
|
39
39
|
|
40
40
|
describe "#server=" do
|
41
41
|
before(:each) do
|
42
|
-
@address = ec2.addresses.new
|
43
|
-
@server = ec2.servers.create(:image_id => GENTOO_AMI)
|
42
|
+
@address = AWS[:ec2].addresses.new
|
43
|
+
@server = AWS[:ec2].servers.create(:image_id => GENTOO_AMI)
|
44
44
|
end
|
45
45
|
|
46
46
|
after(:each) do
|
@@ -61,7 +61,7 @@ describe 'Fog::AWS::EC2::Address' do
|
|
61
61
|
describe "#reload" do
|
62
62
|
|
63
63
|
before(:each) do
|
64
|
-
@address = ec2.addresses.create
|
64
|
+
@address = AWS[:ec2].addresses.create
|
65
65
|
@reloaded = @address.reload
|
66
66
|
end
|
67
67
|
|
@@ -82,7 +82,7 @@ describe 'Fog::AWS::EC2::Address' do
|
|
82
82
|
describe "#save" do
|
83
83
|
|
84
84
|
before(:each) do
|
85
|
-
@address = ec2.addresses.new
|
85
|
+
@address = AWS[:ec2].addresses.new
|
86
86
|
end
|
87
87
|
|
88
88
|
it "should return true when it succeeds" do
|
@@ -5,12 +5,12 @@ describe 'Fog::AWS::EC2::Addresses' do
|
|
5
5
|
describe "#all" do
|
6
6
|
|
7
7
|
it "should return a Fog::AWS::EC2::Addresses" do
|
8
|
-
ec2.addresses.all.should be_a(Fog::AWS::EC2::Addresses)
|
8
|
+
AWS[:ec2].addresses.all.should be_a(Fog::AWS::EC2::Addresses)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should include persisted addresses" do
|
12
|
-
address = ec2.addresses.create
|
13
|
-
ec2.addresses.get(address.public_ip).should_not be_nil
|
12
|
+
address = AWS[:ec2].addresses.create
|
13
|
+
AWS[:ec2].addresses.get(address.public_ip).should_not be_nil
|
14
14
|
address.destroy
|
15
15
|
end
|
16
16
|
|
@@ -19,7 +19,7 @@ describe 'Fog::AWS::EC2::Addresses' do
|
|
19
19
|
describe "#create" do
|
20
20
|
|
21
21
|
before(:each) do
|
22
|
-
@address = ec2.addresses.create
|
22
|
+
@address = AWS[:ec2].addresses.create
|
23
23
|
end
|
24
24
|
|
25
25
|
after(:each) do
|
@@ -31,7 +31,7 @@ describe 'Fog::AWS::EC2::Addresses' do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should exist on ec2" do
|
34
|
-
ec2.addresses.get(@address.public_ip).should_not be_nil
|
34
|
+
AWS[:ec2].addresses.get(@address.public_ip).should_not be_nil
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
@@ -39,14 +39,14 @@ describe 'Fog::AWS::EC2::Addresses' do
|
|
39
39
|
describe "#get" do
|
40
40
|
|
41
41
|
it "should return a Fog::AWS::EC2::Address if a matching address exists" do
|
42
|
-
address = ec2.addresses.create
|
43
|
-
get = ec2.addresses.get(address.public_ip)
|
42
|
+
address = AWS[:ec2].addresses.create
|
43
|
+
get = AWS[:ec2].addresses.get(address.public_ip)
|
44
44
|
address.attributes.should == get.attributes
|
45
45
|
address.destroy
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should return nil if no matching address exists" do
|
49
|
-
ec2.addresses.get('0.0.0.0').should be_nil
|
49
|
+
AWS[:ec2].addresses.get('0.0.0.0').should be_nil
|
50
50
|
end
|
51
51
|
|
52
52
|
end
|
@@ -54,7 +54,7 @@ describe 'Fog::AWS::EC2::Addresses' do
|
|
54
54
|
describe "#new" do
|
55
55
|
|
56
56
|
it "should return a Fog::AWS::EC2::Address" do
|
57
|
-
ec2.addresses.new.should be_a(Fog::AWS::EC2::Address)
|
57
|
+
AWS[:ec2].addresses.new.should be_a(Fog::AWS::EC2::Address)
|
58
58
|
end
|
59
59
|
|
60
60
|
end
|
@@ -62,7 +62,7 @@ describe 'Fog::AWS::EC2::Addresses' do
|
|
62
62
|
describe "#reload" do
|
63
63
|
|
64
64
|
it "should return a Fog::AWS::EC2::Addresses" do
|
65
|
-
ec2.addresses.all.reload.should be_a(Fog::AWS::EC2::Addresses)
|
65
|
+
AWS[:ec2].addresses.all.reload.should be_a(Fog::AWS::EC2::Addresses)
|
66
66
|
end
|
67
67
|
|
68
68
|
end
|
@@ -5,7 +5,7 @@ describe 'Fog::AWS::EC2::KeyPair' do
|
|
5
5
|
describe "#initialize" do
|
6
6
|
|
7
7
|
it "should remap attributes from parser" do
|
8
|
-
key_pair = ec2.key_pairs.new(
|
8
|
+
key_pair = AWS[:ec2].key_pairs.new(
|
9
9
|
'keyFingerprint' => 'fingerprint',
|
10
10
|
'keyMaterial' => 'material',
|
11
11
|
'keyName' => 'name'
|
@@ -20,11 +20,11 @@ describe 'Fog::AWS::EC2::KeyPair' do
|
|
20
20
|
describe "#collection" do
|
21
21
|
|
22
22
|
it "should return a Fog::AWS::EC2::KeyPairs" do
|
23
|
-
ec2.key_pairs.new.collection.should be_a(Fog::AWS::EC2::KeyPairs)
|
23
|
+
AWS[:ec2].key_pairs.new.collection.should be_a(Fog::AWS::EC2::KeyPairs)
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should be the key_pairs the keypair is related to" do
|
27
|
-
key_pairs = ec2.key_pairs
|
27
|
+
key_pairs = AWS[:ec2].key_pairs
|
28
28
|
key_pairs.new.collection.should == key_pairs
|
29
29
|
end
|
30
30
|
|
@@ -33,7 +33,7 @@ describe 'Fog::AWS::EC2::KeyPair' do
|
|
33
33
|
describe "#destroy" do
|
34
34
|
|
35
35
|
it "should return true if the key_pair is deleted" do
|
36
|
-
address = ec2.key_pairs.create(:name => 'keyname')
|
36
|
+
address = AWS[:ec2].key_pairs.create(:name => 'keyname')
|
37
37
|
address.destroy.should be_true
|
38
38
|
end
|
39
39
|
|
@@ -42,7 +42,7 @@ describe 'Fog::AWS::EC2::KeyPair' do
|
|
42
42
|
describe "#reload" do
|
43
43
|
|
44
44
|
before(:each) do
|
45
|
-
@key_pair = ec2.key_pairs.create(:name => 'keyname')
|
45
|
+
@key_pair = AWS[:ec2].key_pairs.create(:name => 'keyname')
|
46
46
|
@reloaded = @key_pair.reload
|
47
47
|
end
|
48
48
|
|
@@ -63,7 +63,7 @@ describe 'Fog::AWS::EC2::KeyPair' do
|
|
63
63
|
describe "#save" do
|
64
64
|
|
65
65
|
before(:each) do
|
66
|
-
@key_pair = ec2.key_pairs.new(:name => 'keyname')
|
66
|
+
@key_pair = AWS[:ec2].key_pairs.new(:name => 'keyname')
|
67
67
|
end
|
68
68
|
|
69
69
|
it "should return true when it succeeds" do
|
@@ -72,12 +72,12 @@ describe 'Fog::AWS::EC2::KeyPair' do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
it "should not exist in key_pairs before save" do
|
75
|
-
ec2.key_pairs.get(@key_pair.name).should be_nil
|
75
|
+
AWS[:ec2].key_pairs.get(@key_pair.name).should be_nil
|
76
76
|
end
|
77
77
|
|
78
78
|
it "should exist in buckets after save" do
|
79
79
|
@key_pair.save
|
80
|
-
ec2.key_pairs.get(@key_pair.name).should_not be_nil
|
80
|
+
AWS[:ec2].key_pairs.get(@key_pair.name).should_not be_nil
|
81
81
|
@key_pair.destroy
|
82
82
|
end
|
83
83
|
|
@@ -5,12 +5,12 @@ describe 'Fog::AWS::EC2::KeyPairs' do
|
|
5
5
|
describe "#all" do
|
6
6
|
|
7
7
|
it "should return a Fog::AWS::EC2::KeyPairs" do
|
8
|
-
ec2.key_pairs.all.should be_a(Fog::AWS::EC2::KeyPairs)
|
8
|
+
AWS[:ec2].key_pairs.all.should be_a(Fog::AWS::EC2::KeyPairs)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should include persisted key_pairs" do
|
12
|
-
key_pair = ec2.key_pairs.create(:name => 'keyname')
|
13
|
-
ec2.key_pairs.get(key_pair.name).should_not be_nil
|
12
|
+
key_pair = AWS[:ec2].key_pairs.create(:name => 'keyname')
|
13
|
+
AWS[:ec2].key_pairs.get(key_pair.name).should_not be_nil
|
14
14
|
key_pair.destroy
|
15
15
|
end
|
16
16
|
|
@@ -19,7 +19,7 @@ describe 'Fog::AWS::EC2::KeyPairs' do
|
|
19
19
|
describe "#create" do
|
20
20
|
|
21
21
|
before(:each) do
|
22
|
-
@key_pair = ec2.key_pairs.create(:name => 'keyname')
|
22
|
+
@key_pair = AWS[:ec2].key_pairs.create(:name => 'keyname')
|
23
23
|
end
|
24
24
|
|
25
25
|
after(:each) do
|
@@ -31,7 +31,7 @@ describe 'Fog::AWS::EC2::KeyPairs' do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should exist on ec2" do
|
34
|
-
ec2.key_pairs.get(@key_pair.name).should_not be_nil
|
34
|
+
AWS[:ec2].key_pairs.get(@key_pair.name).should_not be_nil
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
@@ -39,15 +39,15 @@ describe 'Fog::AWS::EC2::KeyPairs' do
|
|
39
39
|
describe "#get" do
|
40
40
|
|
41
41
|
it "should return a Fog::AWS::EC2::KeyPair if a matching key_pair exists" do
|
42
|
-
key_pair = ec2.key_pairs.create(:name => 'keyname')
|
43
|
-
get = ec2.key_pairs.get(key_pair.name)
|
42
|
+
key_pair = AWS[:ec2].key_pairs.create(:name => 'keyname')
|
43
|
+
get = AWS[:ec2].key_pairs.get(key_pair.name)
|
44
44
|
key_pair.attributes[:fingerprint].should == get.attributes[:fingerprint]
|
45
45
|
key_pair.attributes[:name].should == get.attributes[:name]
|
46
46
|
key_pair.destroy
|
47
47
|
end
|
48
48
|
|
49
49
|
it "should return nil if no matching key_pair exists" do
|
50
|
-
ec2.key_pairs.get('notakeyname').should be_nil
|
50
|
+
AWS[:ec2].key_pairs.get('notakeyname').should be_nil
|
51
51
|
end
|
52
52
|
|
53
53
|
end
|
@@ -55,7 +55,7 @@ describe 'Fog::AWS::EC2::KeyPairs' do
|
|
55
55
|
describe "#new" do
|
56
56
|
|
57
57
|
it "should return a Fog::AWS::EC2::KeyPair" do
|
58
|
-
ec2.key_pairs.new(:name => 'keyname').should be_a(Fog::AWS::EC2::KeyPair)
|
58
|
+
AWS[:ec2].key_pairs.new(:name => 'keyname').should be_a(Fog::AWS::EC2::KeyPair)
|
59
59
|
end
|
60
60
|
|
61
61
|
end
|
@@ -63,7 +63,7 @@ describe 'Fog::AWS::EC2::KeyPairs' do
|
|
63
63
|
describe "#reload" do
|
64
64
|
|
65
65
|
it "should return a Fog::AWS::EC2::KeyPairs" do
|
66
|
-
ec2.key_pairs.all.reload.should be_a(Fog::AWS::EC2::KeyPairs)
|
66
|
+
AWS[:ec2].key_pairs.all.reload.should be_a(Fog::AWS::EC2::KeyPairs)
|
67
67
|
end
|
68
68
|
|
69
69
|
end
|
@@ -5,7 +5,7 @@ describe 'Fog::AWS::EC2::SecurityGroup' do
|
|
5
5
|
describe "#initialize" do
|
6
6
|
|
7
7
|
it "should remap attributes from parser" do
|
8
|
-
security_group = ec2.security_groups.new(
|
8
|
+
security_group = AWS[:ec2].security_groups.new(
|
9
9
|
'groupDescription' => 'description',
|
10
10
|
'groupName' => 'name',
|
11
11
|
'ipPermissions' => 'permissions',
|
@@ -22,11 +22,11 @@ describe 'Fog::AWS::EC2::SecurityGroup' do
|
|
22
22
|
describe "#collection" do
|
23
23
|
|
24
24
|
it "should return a Fog::AWS::EC2::SecurityGroups" do
|
25
|
-
ec2.security_groups.new.collection.should be_a(Fog::AWS::EC2::SecurityGroups)
|
25
|
+
AWS[:ec2].security_groups.new.collection.should be_a(Fog::AWS::EC2::SecurityGroups)
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should be the security_groups the keypair is related to" do
|
29
|
-
security_groups = ec2.security_groups
|
29
|
+
security_groups = AWS[:ec2].security_groups
|
30
30
|
security_groups.new.collection.should == security_groups
|
31
31
|
end
|
32
32
|
|
@@ -35,7 +35,7 @@ describe 'Fog::AWS::EC2::SecurityGroup' do
|
|
35
35
|
describe "#destroy" do
|
36
36
|
|
37
37
|
it "should return true if the security_group is deleted" do
|
38
|
-
address = ec2.security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
38
|
+
address = AWS[:ec2].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
39
39
|
address.destroy.should be_true
|
40
40
|
end
|
41
41
|
|
@@ -44,7 +44,7 @@ describe 'Fog::AWS::EC2::SecurityGroup' do
|
|
44
44
|
describe "#reload" do
|
45
45
|
|
46
46
|
before(:each) do
|
47
|
-
@security_group = ec2.security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
47
|
+
@security_group = AWS[:ec2].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
48
48
|
@reloaded = @security_group.reload
|
49
49
|
end
|
50
50
|
|
@@ -65,7 +65,7 @@ describe 'Fog::AWS::EC2::SecurityGroup' do
|
|
65
65
|
describe "#save" do
|
66
66
|
|
67
67
|
before(:each) do
|
68
|
-
@security_group = ec2.security_groups.new(:description => 'groupdescription', :name => 'keyname')
|
68
|
+
@security_group = AWS[:ec2].security_groups.new(:description => 'groupdescription', :name => 'keyname')
|
69
69
|
end
|
70
70
|
|
71
71
|
it "should return true when it succeeds" do
|
@@ -74,12 +74,12 @@ describe 'Fog::AWS::EC2::SecurityGroup' do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
it "should not exist in security_groups before save" do
|
77
|
-
ec2.security_groups.get(@security_group.name).should be_nil
|
77
|
+
AWS[:ec2].security_groups.get(@security_group.name).should be_nil
|
78
78
|
end
|
79
79
|
|
80
80
|
it "should exist in buckets after save" do
|
81
81
|
@security_group.save
|
82
|
-
ec2.security_groups.get(@security_group.name).should_not be_nil
|
82
|
+
AWS[:ec2].security_groups.get(@security_group.name).should_not be_nil
|
83
83
|
@security_group.destroy
|
84
84
|
end
|
85
85
|
|
@@ -5,12 +5,12 @@ describe 'Fog::AWS::EC2::SecurityGroups' do
|
|
5
5
|
describe "#all" do
|
6
6
|
|
7
7
|
it "should return a Fog::AWS::EC2::SecurityGroups" do
|
8
|
-
ec2.security_groups.all.should be_a(Fog::AWS::EC2::SecurityGroups)
|
8
|
+
AWS[:ec2].security_groups.all.should be_a(Fog::AWS::EC2::SecurityGroups)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should include persisted security_groups" do
|
12
|
-
security_group = ec2.security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
13
|
-
ec2.security_groups.get(security_group.name).should_not be_nil
|
12
|
+
security_group = AWS[:ec2].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
13
|
+
AWS[:ec2].security_groups.get(security_group.name).should_not be_nil
|
14
14
|
security_group.destroy
|
15
15
|
end
|
16
16
|
|
@@ -19,7 +19,7 @@ describe 'Fog::AWS::EC2::SecurityGroups' do
|
|
19
19
|
describe "#create" do
|
20
20
|
|
21
21
|
before(:each) do
|
22
|
-
@security_group = ec2.security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
22
|
+
@security_group = AWS[:ec2].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
23
23
|
end
|
24
24
|
|
25
25
|
after(:each) do
|
@@ -31,7 +31,7 @@ describe 'Fog::AWS::EC2::SecurityGroups' do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should exist on ec2" do
|
34
|
-
ec2.security_groups.get(@security_group.name).should_not be_nil
|
34
|
+
AWS[:ec2].security_groups.get(@security_group.name).should_not be_nil
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
@@ -39,15 +39,15 @@ describe 'Fog::AWS::EC2::SecurityGroups' do
|
|
39
39
|
describe "#get" do
|
40
40
|
|
41
41
|
it "should return a Fog::AWS::EC2::SecurityGroup if a matching security_group exists" do
|
42
|
-
security_group = ec2.security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
43
|
-
get = ec2.security_groups.get(security_group.name)
|
42
|
+
security_group = AWS[:ec2].security_groups.create(:description => 'groupdescription', :name => 'keyname')
|
43
|
+
get = AWS[:ec2].security_groups.get(security_group.name)
|
44
44
|
security_group.attributes[:fingerprint].should == get.attributes[:fingerprint]
|
45
45
|
security_group.attributes[:name].should == get.attributes[:name]
|
46
46
|
security_group.destroy
|
47
47
|
end
|
48
48
|
|
49
49
|
it "should return nil if no matching security_group exists" do
|
50
|
-
ec2.security_groups.get('notasecuritygroupname').should be_nil
|
50
|
+
AWS[:ec2].security_groups.get('notasecuritygroupname').should be_nil
|
51
51
|
end
|
52
52
|
|
53
53
|
end
|
@@ -55,7 +55,7 @@ describe 'Fog::AWS::EC2::SecurityGroups' do
|
|
55
55
|
describe "#new" do
|
56
56
|
|
57
57
|
it "should return a Fog::AWS::EC2::SecurityGroup" do
|
58
|
-
ec2.security_groups.new(:description => 'groupdescription', :name => 'keyname').should be_a(Fog::AWS::EC2::SecurityGroup)
|
58
|
+
AWS[:ec2].security_groups.new(:description => 'groupdescription', :name => 'keyname').should be_a(Fog::AWS::EC2::SecurityGroup)
|
59
59
|
end
|
60
60
|
|
61
61
|
end
|
@@ -63,7 +63,7 @@ describe 'Fog::AWS::EC2::SecurityGroups' do
|
|
63
63
|
describe "#reload" do
|
64
64
|
|
65
65
|
it "should return a Fog::AWS::EC2::SecurityGroups" do
|
66
|
-
ec2.security_groups.all.reload.should be_a(Fog::AWS::EC2::SecurityGroups)
|
66
|
+
AWS[:ec2].security_groups.all.reload.should be_a(Fog::AWS::EC2::SecurityGroups)
|
67
67
|
end
|
68
68
|
|
69
69
|
end
|
@@ -8,7 +8,7 @@ describe 'Fog::AWS::EC2::Server' do
|
|
8
8
|
subject { @server = @servers.new(:image_id => GENTOO_AMI) }
|
9
9
|
|
10
10
|
before(:each) do
|
11
|
-
@servers = ec2.servers
|
11
|
+
@servers = AWS[:ec2].servers
|
12
12
|
end
|
13
13
|
|
14
14
|
after(:each) do
|
@@ -24,7 +24,6 @@ describe 'Fog::AWS::EC2::Server' do
|
|
24
24
|
server = @servers.new({
|
25
25
|
'amiLaunchIndex' => 'ami_launch_index',
|
26
26
|
'dnsName' => 'dns_name',
|
27
|
-
'groupId' => 'group_id',
|
28
27
|
'imageId' => 'image_id',
|
29
28
|
'instanceId' => 'instance_id',
|
30
29
|
'instanceType' => 'instance_type',
|
@@ -37,10 +36,8 @@ describe 'Fog::AWS::EC2::Server' do
|
|
37
36
|
})
|
38
37
|
server.ami_launch_index.should == 'ami_launch_index'
|
39
38
|
server.dns_name.should == 'dns_name'
|
40
|
-
server.group_id.should == 'group_id'
|
41
39
|
server.image_id.should == 'image_id'
|
42
40
|
server.id.should == 'instance_id'
|
43
|
-
server.flavor.should == 'instance_type'
|
44
41
|
server.kernel_id.should == 'kernel_id'
|
45
42
|
server.key_name.should == 'key_name'
|
46
43
|
server.created_at.should == 'launch_time'
|
@@ -5,7 +5,7 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
5
5
|
describe "#initialize" do
|
6
6
|
|
7
7
|
it "should remap attributes from parser" do
|
8
|
-
snapshot = ec2.snapshots.new(
|
8
|
+
snapshot = AWS[:ec2].snapshots.new(
|
9
9
|
'snapshotId' => 'snap-00000000',
|
10
10
|
'startTime' => 'now',
|
11
11
|
'volumeId' => 'vol-00000000'
|
@@ -20,11 +20,11 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
20
20
|
describe "#collection" do
|
21
21
|
|
22
22
|
it "should return a Fog::AWS::EC2::Snapshots" do
|
23
|
-
ec2.snapshots.new.collection.should be_a(Fog::AWS::EC2::Snapshots)
|
23
|
+
AWS[:ec2].snapshots.new.collection.should be_a(Fog::AWS::EC2::Snapshots)
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should be the snapshots the snapshot is related to" do
|
27
|
-
snapshots = ec2.snapshots
|
27
|
+
snapshots = AWS[:ec2].snapshots
|
28
28
|
snapshots.new.collection.should == snapshots
|
29
29
|
end
|
30
30
|
|
@@ -33,7 +33,7 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
33
33
|
describe "#destroy" do
|
34
34
|
|
35
35
|
it "should return true if the snapshot is deleted" do
|
36
|
-
volume = ec2.volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
36
|
+
volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
37
37
|
snapshot = volume.snapshots.create
|
38
38
|
snapshot.wait_for { status == "completed" }
|
39
39
|
snapshot.destroy.should be_true
|
@@ -45,7 +45,7 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
45
45
|
describe "#reload" do
|
46
46
|
|
47
47
|
before(:each) do
|
48
|
-
@volume = ec2.volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
48
|
+
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
49
49
|
@snapshot = @volume.snapshots.create
|
50
50
|
@reloaded = @snapshot.reload
|
51
51
|
end
|
@@ -68,7 +68,7 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
68
68
|
describe "#save" do
|
69
69
|
|
70
70
|
before(:each) do
|
71
|
-
@volume = ec2.volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
71
|
+
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
72
72
|
@snapshot = @volume.snapshots.new
|
73
73
|
end
|
74
74
|
|
@@ -77,17 +77,19 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
77
77
|
end
|
78
78
|
|
79
79
|
it "should return true when it succeeds" do
|
80
|
-
|
81
|
-
|
80
|
+
eventually do
|
81
|
+
@snapshot.save.should be_true
|
82
|
+
@snapshot.destroy
|
83
|
+
end
|
82
84
|
end
|
83
85
|
|
84
86
|
it "should not exist in addresses before save" do
|
85
|
-
ec2.snapshots.get(@snapshot.id).should be_nil
|
87
|
+
AWS[:ec2].snapshots.get(@snapshot.id).should be_nil
|
86
88
|
end
|
87
89
|
|
88
90
|
it "should exist in buckets after save" do
|
89
91
|
@snapshot.save
|
90
|
-
ec2.snapshots.get(@snapshot.id).should_not be_nil
|
92
|
+
AWS[:ec2].snapshots.get(@snapshot.id).should_not be_nil
|
91
93
|
@snapshot.destroy
|
92
94
|
end
|
93
95
|
|