fog 0.3.13 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/fog.gemspec +26 -20
- data/lib/fog.rb +1 -11
- data/lib/fog/aws.rb +5 -0
- data/lib/fog/aws/bin.rb +5 -1
- data/lib/fog/aws/cdn.rb +98 -0
- data/lib/fog/aws/iam.rb +86 -0
- data/lib/fog/aws/models/compute/volume.rb +10 -0
- data/lib/fog/aws/models/storage/directory.rb +11 -0
- data/lib/fog/aws/models/storage/file.rb +9 -11
- data/lib/fog/aws/parsers/cdn/distribution.rb +44 -0
- data/lib/fog/aws/parsers/cdn/get_distribution_list.rb +48 -0
- data/lib/fog/aws/parsers/cdn/post_invalidation.rb +28 -0
- data/lib/fog/aws/parsers/iam/basic.rb +19 -0
- data/lib/fog/aws/parsers/iam/create_group.rb +26 -0
- data/lib/fog/aws/parsers/iam/list_groups.rb +32 -0
- data/lib/fog/aws/requests/cdn/delete_distribution.rb +36 -0
- data/lib/fog/aws/requests/cdn/get_distribution.rb +55 -0
- data/lib/fog/aws/requests/cdn/get_distribution_list.rb +59 -0
- data/lib/fog/aws/requests/cdn/post_distribution.rb +88 -0
- data/lib/fog/aws/requests/cdn/post_invalidation.rb +59 -0
- data/lib/fog/aws/requests/compute/create_volume.rb +1 -0
- data/lib/fog/aws/requests/compute/describe_snapshots.rb +3 -0
- data/lib/fog/aws/requests/iam/create_group.rb +43 -0
- data/lib/fog/aws/requests/iam/delete_group.rb +36 -0
- data/lib/fog/aws/requests/iam/list_groups.rb +45 -0
- data/lib/fog/aws/requests/storage/copy_object.rb +4 -1
- data/lib/fog/aws/requests/storage/delete_bucket.rb +5 -1
- data/lib/fog/aws/requests/storage/delete_object.rb +5 -1
- data/lib/fog/aws/requests/storage/get_bucket.rb +4 -1
- data/lib/fog/aws/requests/storage/get_bucket_acl.rb +4 -1
- data/lib/fog/aws/requests/storage/get_bucket_location.rb +5 -1
- data/lib/fog/aws/requests/storage/get_bucket_logging.rb +4 -1
- data/lib/fog/aws/requests/storage/get_bucket_object_versions.rb +4 -1
- data/lib/fog/aws/requests/storage/get_bucket_versioning.rb +4 -1
- data/lib/fog/aws/requests/storage/get_object.rb +4 -1
- data/lib/fog/aws/requests/storage/get_object_acl.rb +4 -1
- data/lib/fog/aws/requests/storage/get_object_torrent.rb +4 -1
- data/lib/fog/aws/requests/storage/get_object_url.rb +4 -1
- data/lib/fog/aws/requests/storage/get_request_payment.rb +5 -1
- data/lib/fog/aws/requests/storage/get_service.rb +5 -1
- data/lib/fog/aws/requests/storage/head_object.rb +5 -1
- data/lib/fog/aws/requests/storage/post_object_hidden_fields.rb +4 -3
- data/lib/fog/aws/requests/storage/put_bucket.rb +11 -6
- data/lib/fog/aws/requests/storage/put_bucket_acl.rb +5 -1
- data/lib/fog/aws/requests/storage/put_bucket_logging.rb +5 -1
- data/lib/fog/aws/requests/storage/put_bucket_versioning.rb +5 -1
- data/lib/fog/aws/requests/storage/put_object.rb +5 -1
- data/lib/fog/aws/requests/storage/put_object_url.rb +4 -1
- data/lib/fog/aws/requests/storage/put_request_payment.rb +5 -1
- data/lib/fog/aws/storage.rb +2 -0
- data/lib/fog/bluebox/compute.rb +1 -0
- data/lib/fog/core.rb +4 -2
- data/lib/fog/core/attributes.rb +9 -5
- data/lib/fog/core/compute.rb +33 -0
- data/lib/fog/core/credentials.rb +0 -1
- data/lib/fog/core/model.rb +2 -11
- data/lib/fog/core/ssh.rb +1 -0
- data/lib/fog/core/storage.rb +24 -0
- data/lib/fog/go_grid/compute.rb +2 -0
- data/lib/fog/google.rb +3 -0
- data/lib/fog/google/models/storage/directory.rb +11 -0
- data/lib/fog/google/models/storage/file.rb +19 -10
- data/lib/fog/google/requests/storage/put_bucket.rb +5 -4
- data/lib/fog/google/storage.rb +2 -0
- data/lib/fog/linode/compute.rb +1 -0
- data/lib/fog/new_servers.rb +3 -0
- data/lib/fog/rackspace.rb +1 -0
- data/lib/fog/rackspace/bin.rb +3 -1
- data/lib/fog/rackspace/cdn.rb +81 -0
- data/lib/fog/rackspace/compute.rb +1 -0
- data/lib/fog/rackspace/models/storage/file.rb +2 -2
- data/lib/fog/rackspace/requests/{storage → cdn}/get_cdn_containers.rb +1 -1
- data/lib/fog/rackspace/requests/{storage → cdn}/head_cdn_container.rb +1 -1
- data/lib/fog/rackspace/requests/{storage → cdn}/put_cdn_container.rb +1 -1
- data/lib/fog/rackspace/requests/storage/delete_container.rb +1 -1
- data/lib/fog/rackspace/requests/storage/delete_object.rb +1 -1
- data/lib/fog/rackspace/requests/storage/get_container.rb +1 -1
- data/lib/fog/rackspace/requests/storage/get_containers.rb +1 -1
- data/lib/fog/rackspace/requests/storage/get_object.rb +1 -1
- data/lib/fog/rackspace/requests/storage/head_container.rb +1 -1
- data/lib/fog/rackspace/requests/storage/head_containers.rb +1 -1
- data/lib/fog/rackspace/requests/storage/head_object.rb +1 -1
- data/lib/fog/rackspace/requests/storage/put_container.rb +1 -1
- data/lib/fog/rackspace/requests/storage/put_object.rb +1 -1
- data/lib/fog/rackspace/storage.rb +13 -47
- data/lib/fog/slicehost.rb +4 -1
- data/lib/fog/terremark.rb +3 -0
- data/lib/fog/vcloud.rb +3 -0
- data/spec/aws/models/storage/directory_spec.rb +1 -0
- data/spec/bluebox/models/compute/flavors_spec.rb +5 -2
- data/spec/bluebox/models/compute/server_spec.rb +5 -1
- data/spec/bluebox/models/compute/servers_spec.rb +5 -1
- data/spec/google/models/storage/files_spec.rb +1 -2
- data/spec/rackspace/models/compute/flavors_spec.rb +5 -1
- data/spec/rackspace/models/compute/server_spec.rb +5 -1
- data/spec/slicehost/models/compute/flavors_spec.rb +5 -1
- data/spec/slicehost/models/compute/server_spec.rb +5 -1
- data/spec/slicehost/models/compute/servers_spec.rb +5 -1
- data/tests/aws/requests/compute/volume_tests.rb +8 -7
- data/tests/aws/requests/storage/bucket_tests.rb +55 -0
- data/tests/aws/requests/storage/object_tests.rb +18 -0
- data/tests/rackspace/requests/storage/container_tests.rb +64 -0
- data/tests/rackspace/requests/storage/object_tests.rb +69 -0
- metadata +27 -21
- data/spec/aws/requests/storage/copy_object_spec.rb +0 -61
- data/spec/aws/requests/storage/get_bucket_location_spec.rb +0 -30
- data/spec/aws/requests/storage/get_bucket_spec.rb +0 -114
- data/spec/aws/requests/storage/get_request_payment_spec.rb +0 -30
- data/spec/aws/requests/storage/put_request_payment_spec.rb +0 -29
- data/spec/rackspace/requests/storage/delete_container_spec.rb +0 -24
- data/spec/rackspace/requests/storage/delete_object_spec.rb +0 -37
- data/spec/rackspace/requests/storage/get_container_spec.rb +0 -35
- data/spec/rackspace/requests/storage/get_containers_spec.rb +0 -22
- data/spec/rackspace/requests/storage/get_object_spec.rb +0 -21
- data/spec/rackspace/requests/storage/head_container_spec.rb +0 -30
- data/spec/rackspace/requests/storage/head_containers_spec.rb +0 -19
- data/spec/rackspace/requests/storage/head_object_spec.rb +0 -21
- data/spec/rackspace/requests/storage/put_container_spec.rb +0 -15
- data/spec/rackspace/requests/storage/put_object_spec.rb +0 -20
@@ -1,61 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Storage.copy_object' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
AWS[:storage].put_bucket('fogcopyobjectsource')
|
8
|
-
AWS[:storage].put_object('fogcopyobjectsource', 'fog_copy_object_source', lorem_file)
|
9
|
-
AWS[:storage].put_bucket('fogcopyobjectdestination')
|
10
|
-
end
|
11
|
-
|
12
|
-
after(:each) do
|
13
|
-
AWS[:storage].delete_object('fogcopyobjectdestination', 'fog_copy_object_destination')
|
14
|
-
AWS[:storage].delete_bucket('fogcopyobjectdestination')
|
15
|
-
AWS[:storage].delete_object('fogcopyobjectsource', 'fog_copy_object_source')
|
16
|
-
AWS[:storage].delete_bucket('fogcopyobjectsource')
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should return proper attributes' do
|
20
|
-
actual = AWS[:storage].copy_object(
|
21
|
-
'fogcopyobjectsource', 'fog_copy_object_source',
|
22
|
-
'fogcopyobjectdestination', 'fog_copy_object_destination'
|
23
|
-
)
|
24
|
-
actual.status.should == 200
|
25
|
-
actual.body['ETag'].should be_a(String)
|
26
|
-
actual.body['LastModified'].should be_a(Time)
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
describe 'failure' do
|
31
|
-
|
32
|
-
it 'should raise a NotFound error if the source_bucket does not exist' do
|
33
|
-
lambda {
|
34
|
-
AWS[:storage].copy_object(
|
35
|
-
'fognotabucket', 'fog_copy_object_source',
|
36
|
-
'fogcopyobjectdestination', 'fog_copy_object_destination'
|
37
|
-
)
|
38
|
-
}.should raise_error(Excon::Errors::NotFound)
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'should raise a NotFound error if the source_object does not exist' do
|
42
|
-
lambda {
|
43
|
-
AWS[:storage].copy_object(
|
44
|
-
'fogcopyobjectsource', 'fog_not_an_object',
|
45
|
-
'fogcopyobjectdestination', 'fog_copy_object_destination'
|
46
|
-
)
|
47
|
-
}.should raise_error(Excon::Errors::NotFound)
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'should raise a NotFound error if the target_bucket does not exist' do
|
51
|
-
lambda {
|
52
|
-
AWS[:storage].copy_object(
|
53
|
-
'fogcopyobjectsource', 'fog_copy_object_source',
|
54
|
-
'fognotabucket', 'fog_copy_object_destination'
|
55
|
-
)
|
56
|
-
}.should raise_error(Excon::Errors::NotFound)
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Storage.get_bucket_location' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
AWS[:storage].put_bucket('foggetlocation', 'LocationConstraint' => 'EU')
|
8
|
-
end
|
9
|
-
|
10
|
-
after(:each) do
|
11
|
-
AWS[:eu_storage].delete_bucket('foggetlocation')
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should return proper attributes' do
|
15
|
-
actual = AWS[:storage].get_bucket_location('foggetlocation')
|
16
|
-
actual.status.should == 200
|
17
|
-
actual.body['LocationConstraint'].should == 'EU'
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
describe 'failure' do
|
22
|
-
|
23
|
-
it 'should raise NotFound error if bucket does not exist' do
|
24
|
-
lambda {
|
25
|
-
AWS[:storage].get_bucket_location('fognotabucket')
|
26
|
-
}.should raise_error(Excon::Errors::NotFound)
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
@@ -1,114 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Storage.get_bucket' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:all) do
|
7
|
-
AWS[:storage].put_bucket('foggetbucket')
|
8
|
-
AWS[:storage].put_object('foggetbucket', 'fog_object', lorem_file)
|
9
|
-
AWS[:storage].put_object('foggetbucket', 'fog_other_object', lorem_file)
|
10
|
-
end
|
11
|
-
|
12
|
-
after(:all) do
|
13
|
-
AWS[:storage].delete_object('foggetbucket', 'fog_object')
|
14
|
-
AWS[:storage].delete_object('foggetbucket', 'fog_other_object')
|
15
|
-
AWS[:storage].delete_bucket('foggetbucket')
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should return proper attributes' do
|
19
|
-
actual = AWS[:storage].get_bucket('foggetbucket')
|
20
|
-
actual.body['IsTruncated'].should == false
|
21
|
-
actual.body['Marker'].should be_nil
|
22
|
-
actual.body['MaxKeys'].should be_an(Integer)
|
23
|
-
actual.body['Name'].should be_a(String)
|
24
|
-
actual.body['Prefix'].should be_nil
|
25
|
-
actual.body['Contents'].should be_an(Array)
|
26
|
-
actual.body['Contents'].length.should == 2
|
27
|
-
object = actual.body['Contents'].first
|
28
|
-
object['ETag'].should be_a(String)
|
29
|
-
object['Key'].should == 'fog_object'
|
30
|
-
object['LastModified'].should be_a(Time)
|
31
|
-
owner = object['Owner']
|
32
|
-
owner['DisplayName'].should be_a(String)
|
33
|
-
owner['ID'].should be_a(String)
|
34
|
-
object['Size'].should be_an(Integer)
|
35
|
-
object['StorageClass'].should be_a(String)
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should accept marker option' do
|
39
|
-
actual = AWS[:storage].get_bucket('foggetbucket', 'marker' => 'fog_object')
|
40
|
-
actual.body['IsTruncated'].should == false
|
41
|
-
actual.body['Marker'].should be_a(String)
|
42
|
-
actual.body['MaxKeys'].should be_an(Integer)
|
43
|
-
actual.body['Name'].should be_a(String)
|
44
|
-
actual.body['Prefix'].should be_nil
|
45
|
-
actual.body['Contents'].should be_an(Array)
|
46
|
-
actual.body['Contents'].length.should == 1
|
47
|
-
object = actual.body['Contents'].first
|
48
|
-
object['ETag'].should be_a(String)
|
49
|
-
object['Key'].should == 'fog_other_object'
|
50
|
-
object['LastModified'].should be_a(Time)
|
51
|
-
owner = object['Owner']
|
52
|
-
owner['DisplayName'].should be_a(String)
|
53
|
-
owner['ID'].should be_a(String)
|
54
|
-
object['Size'].should be_an(Integer)
|
55
|
-
object['StorageClass'].should be_a(String)
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'should accept max-keys option' do
|
59
|
-
actual = AWS[:storage].get_bucket('foggetbucket', 'max-keys' => 1)
|
60
|
-
actual.body['IsTruncated'].should == true
|
61
|
-
actual.body['Marker'].should be_nil
|
62
|
-
actual.body['MaxKeys'].should be_an(Integer)
|
63
|
-
actual.body['Name'].should be_a(String)
|
64
|
-
actual.body['Prefix'].should be_nil
|
65
|
-
actual.body['Contents'].should be_an(Array)
|
66
|
-
actual.body['Contents'].length.should == 1
|
67
|
-
object = actual.body['Contents'].first
|
68
|
-
object['ETag'].should be_a(String)
|
69
|
-
object['Key'].should == 'fog_object'
|
70
|
-
object['LastModified'].should be_a(Time)
|
71
|
-
owner = object['Owner']
|
72
|
-
owner['DisplayName'].should be_a(String)
|
73
|
-
owner['ID'].should be_a(String)
|
74
|
-
object['Size'].should be_an(Integer)
|
75
|
-
object['StorageClass'].should be_a(String)
|
76
|
-
end
|
77
|
-
|
78
|
-
it 'should accept prefix option' do
|
79
|
-
actual = AWS[:storage].get_bucket('foggetbucket', 'prefix' => 'fog_ob')
|
80
|
-
actual.body['IsTruncated'].should == false
|
81
|
-
actual.body['Marker'].should be_nil
|
82
|
-
actual.body['MaxKeys'].should be_an(Integer)
|
83
|
-
actual.body['Name'].should be_a(String)
|
84
|
-
actual.body['Prefix'].should be_a(String)
|
85
|
-
actual.body['Contents'].should be_an(Array)
|
86
|
-
actual.body['Contents'].length.should == 1
|
87
|
-
object = actual.body['Contents'].first
|
88
|
-
object['ETag'].should be_a(String)
|
89
|
-
object['Key'].should == 'fog_object'
|
90
|
-
object['LastModified'].should be_a(Time)
|
91
|
-
owner = object['Owner']
|
92
|
-
owner['DisplayName'].should be_a(String)
|
93
|
-
owner['ID'].should be_a(String)
|
94
|
-
object['Size'].should be_an(Integer)
|
95
|
-
object['StorageClass'].should be_a(String)
|
96
|
-
end
|
97
|
-
|
98
|
-
end
|
99
|
-
describe 'failure' do
|
100
|
-
|
101
|
-
it 'should raise a NotFound error if the bucket does not exist' do
|
102
|
-
lambda {
|
103
|
-
AWS[:storage].get_bucket('fognotabucket')
|
104
|
-
}.should raise_error(Excon::Errors::NotFound)
|
105
|
-
end
|
106
|
-
|
107
|
-
it 'should request non-subdomain buckets and raise a NotFound error' do
|
108
|
-
lambda {
|
109
|
-
AWS[:storage].get_bucket('A-invalid--name')
|
110
|
-
}.should raise_error(Excon::Errors::NotFound)
|
111
|
-
end
|
112
|
-
|
113
|
-
end
|
114
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Storage.get_request_payment' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
AWS[:storage].put_bucket('foggetrequestpayment')
|
8
|
-
end
|
9
|
-
|
10
|
-
after(:each) do
|
11
|
-
AWS[:storage].delete_bucket('foggetrequestpayment')
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should return proper attributes' do
|
15
|
-
actual = AWS[:storage].get_request_payment('foggetrequestpayment')
|
16
|
-
actual.status.should == 200
|
17
|
-
actual.body['Payer'].should == 'BucketOwner'
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
describe 'failure' do
|
22
|
-
|
23
|
-
it 'should raise a NotFound error if the bucket does not exist' do
|
24
|
-
lambda {
|
25
|
-
AWS[:storage].get_request_payment('fognotabucket')
|
26
|
-
}.should raise_error(Excon::Errors::NotFound)
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Storage.put_request_payment' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
AWS[:storage].put_bucket('fogputrequestpayment')
|
8
|
-
end
|
9
|
-
|
10
|
-
after(:each) do
|
11
|
-
AWS[:storage].delete_bucket('fogputrequestpayment')
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should return proper attributes' do
|
15
|
-
actual = AWS[:storage].put_request_payment('fogputrequestpayment', 'Requester')
|
16
|
-
actual.status.should == 200
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
describe 'failure' do
|
21
|
-
|
22
|
-
it 'should raise a NotFound error if bucket does not exist' do
|
23
|
-
lambda {
|
24
|
-
AWS[:storage].put_request_payment('fognotabucket', 'Requester')
|
25
|
-
}.should raise_error(Excon::Errors::NotFound)
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Rackspace::Storage.delete_container' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
Rackspace[:storage].put_container('container_name')
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should return proper attributes" do
|
11
|
-
Rackspace[:storage].delete_container('container_name')
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
describe 'failure' do
|
16
|
-
|
17
|
-
it "should raise a NotFound error if the container does not exist" do
|
18
|
-
lambda do
|
19
|
-
Rackspace[:storage].delete_container('container_name')
|
20
|
-
end.should raise_error(Fog::Rackspace::Storage::NotFound)
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Rackspace::Storage.delete_object' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
Rackspace[:storage].put_container('container_name')
|
8
|
-
Rackspace[:storage].put_object('container_name', 'object_name', lorem_file)
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
Rackspace[:storage].delete_container('container_name')
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should return proper attributes" do
|
16
|
-
Rackspace[:storage].delete_object('container_name', 'object_name')
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
describe 'failure' do
|
21
|
-
|
22
|
-
it "should raise a NotFound error if the container does not exist" do
|
23
|
-
lambda do
|
24
|
-
Rackspace[:storage].delete_object('container_name', 'object_name')
|
25
|
-
end.should raise_error(Fog::Rackspace::Storage::NotFound)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should raise a NotFound error if the object does not exist" do
|
29
|
-
Rackspace[:storage].put_container('container_name')
|
30
|
-
lambda do
|
31
|
-
Rackspace[:storage].delete_object('container_name', 'object_name')
|
32
|
-
end.should raise_error(Fog::Rackspace::Storage::NotFound)
|
33
|
-
Rackspace[:storage].delete_container('container_name')
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Rackspace::Storage.get_container' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
Rackspace[:storage].put_container('container_name')
|
8
|
-
Rackspace[:storage].put_object('container_name', 'object_name', lorem_file)
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
Rackspace[:storage].delete_object('container_name', 'object_name')
|
13
|
-
Rackspace[:storage].delete_container('container_name')
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should return proper attributes" do
|
17
|
-
actual = Rackspace[:storage].get_container('container_name').body
|
18
|
-
actual.first['bytes'].should be_an(Integer)
|
19
|
-
actual.first['content_type'].should be_a(String)
|
20
|
-
actual.first['hash'].should be_a(String)
|
21
|
-
actual.first['last_modified'].should be_a(String)
|
22
|
-
actual.first['name'].should be_a(String)
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
describe 'failure' do
|
27
|
-
|
28
|
-
it "should raise a NotFound error if the container does not exist" do
|
29
|
-
lambda do
|
30
|
-
Rackspace[:storage].get_container('container_name')
|
31
|
-
end.should raise_error(Fog::Rackspace::Storage::NotFound)
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Rackspace::Storage.get_containers' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
Rackspace[:storage].put_container('container_name')
|
8
|
-
end
|
9
|
-
|
10
|
-
after(:each) do
|
11
|
-
Rackspace[:storage].delete_container('container_name')
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should return proper attributes" do
|
15
|
-
actual = Rackspace[:storage].get_containers.body
|
16
|
-
actual.first['bytes'].should be_an(Integer)
|
17
|
-
actual.first['count'].should be_an(Integer)
|
18
|
-
actual.first['name'].should be_a(String)
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Rackspace::Storage.get_object' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
Rackspace[:storage].put_container('container_name')
|
8
|
-
Rackspace[:storage].put_object('container_name', 'object_name', lorem_file)
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
Rackspace[:storage].delete_object('container_name', 'object_name')
|
13
|
-
Rackspace[:storage].delete_container('container_name')
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should return proper attributes" do
|
17
|
-
Rackspace[:storage].get_object('container_name', 'object_name')
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
-
|
3
|
-
describe 'Rackspace::Storage.head_container' do
|
4
|
-
describe 'success' do
|
5
|
-
|
6
|
-
before(:each) do
|
7
|
-
Rackspace[:storage].put_container('container_name')
|
8
|
-
Rackspace[:storage].put_object('container_name', 'object_name', lorem_file)
|
9
|
-
end
|
10
|
-
|
11
|
-
after(:each) do
|
12
|
-
Rackspace[:storage].delete_object('container_name', 'object_name')
|
13
|
-
Rackspace[:storage].delete_container('container_name')
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should return proper attributes" do
|
17
|
-
Rackspace[:storage].head_container('container_name')
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
describe 'failure' do
|
22
|
-
|
23
|
-
it "should raise a NotFound error if the container does not exist" do
|
24
|
-
lambda do
|
25
|
-
Rackspace[:storage].head_container('container_name')
|
26
|
-
end.should raise_error(Fog::Rackspace::Storage::NotFound)
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|