fog 0.0.40 → 0.0.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/README.rdoc +2 -0
  2. data/Rakefile +12 -0
  3. data/VERSION +1 -1
  4. data/bin/fog +28 -40
  5. data/fog.gemspec +16 -3
  6. data/lib/fog.rb +27 -3
  7. data/lib/fog/aws/ec2.rb +7 -3
  8. data/lib/fog/aws/models/ec2/security_group.rb +1 -1
  9. data/lib/fog/aws/models/ec2/server.rb +8 -3
  10. data/lib/fog/aws/models/ec2/servers.rb +1 -1
  11. data/lib/fog/aws/parsers/ec2/terminate_instances.rb +10 -10
  12. data/lib/fog/aws/requests/ec2/run_instances.rb +1 -1
  13. data/lib/fog/aws/s3.rb +6 -2
  14. data/lib/fog/rackspace.rb +8 -2
  15. data/lib/fog/slicehost.rb +3 -1
  16. data/spec/aws/models/ec2/address_spec.rb +8 -8
  17. data/spec/aws/models/ec2/addresses_spec.rb +10 -10
  18. data/spec/aws/models/ec2/key_pair_spec.rb +8 -8
  19. data/spec/aws/models/ec2/key_pairs_spec.rb +10 -10
  20. data/spec/aws/models/ec2/security_group_spec.rb +8 -8
  21. data/spec/aws/models/ec2/security_groups_spec.rb +10 -10
  22. data/spec/aws/models/ec2/server_spec.rb +1 -4
  23. data/spec/aws/models/ec2/servers_spec.rb +1 -1
  24. data/spec/aws/models/ec2/snapshot_spec.rb +12 -10
  25. data/spec/aws/models/ec2/snapshots_spec.rb +20 -20
  26. data/spec/aws/models/ec2/volume_spec.rb +10 -10
  27. data/spec/aws/models/ec2/volumes_spec.rb +10 -10
  28. data/spec/aws/models/s3/directories_spec.rb +8 -8
  29. data/spec/aws/models/s3/directory_spec.rb +11 -11
  30. data/spec/aws/models/s3/file_spec.rb +2 -2
  31. data/spec/aws/models/s3/files_spec.rb +2 -2
  32. data/spec/aws/requests/ec2/allocate_address_spec.rb +2 -2
  33. data/spec/aws/requests/ec2/associate_address_spec.rb +15 -13
  34. data/spec/aws/requests/ec2/attach_volume_spec.rb +12 -12
  35. data/spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb +3 -3
  36. data/spec/aws/requests/ec2/create_key_pair_spec.rb +5 -5
  37. data/spec/aws/requests/ec2/create_security_group_spec.rb +5 -5
  38. data/spec/aws/requests/ec2/create_snapshot_spec.rb +5 -5
  39. data/spec/aws/requests/ec2/create_volume_spec.rb +2 -2
  40. data/spec/aws/requests/ec2/delete_key_pair_spec.rb +3 -3
  41. data/spec/aws/requests/ec2/delete_security_group_spec.rb +3 -3
  42. data/spec/aws/requests/ec2/delete_snapshot_spec.rb +5 -5
  43. data/spec/aws/requests/ec2/delete_volume_spec.rb +3 -3
  44. data/spec/aws/requests/ec2/describe_addresses_spec.rb +5 -5
  45. data/spec/aws/requests/ec2/describe_availability_zones_spec.rb +2 -2
  46. data/spec/aws/requests/ec2/describe_images_spec.rb +2 -2
  47. data/spec/aws/requests/ec2/describe_instances_spec.rb +5 -5
  48. data/spec/aws/requests/ec2/describe_key_pairs_spec.rb +5 -5
  49. data/spec/aws/requests/ec2/describe_regions_spec.rb +2 -2
  50. data/spec/aws/requests/ec2/describe_security_groups_spec.rb +5 -5
  51. data/spec/aws/requests/ec2/describe_snapshots_spec.rb +7 -7
  52. data/spec/aws/requests/ec2/describe_volumes_spec.rb +5 -5
  53. data/spec/aws/requests/ec2/detach_volume_spec.rb +7 -7
  54. data/spec/aws/requests/ec2/disassociate_address_spec.rb +9 -7
  55. data/spec/aws/requests/ec2/get_console_output_spec.rb +4 -4
  56. data/spec/aws/requests/ec2/reboot_instances_spec.rb +4 -4
  57. data/spec/aws/requests/ec2/release_address_spec.rb +3 -3
  58. data/spec/aws/requests/ec2/revoke_security_group_ingress_spec.rb +4 -4
  59. data/spec/aws/requests/ec2/run_instances_spec.rb +2 -2
  60. data/spec/aws/requests/ec2/terminate_instances_spec.rb +7 -7
  61. data/spec/aws/requests/s3/copy_object_spec.rb +11 -11
  62. data/spec/aws/requests/s3/delete_bucket_spec.rb +8 -8
  63. data/spec/aws/requests/s3/delete_object_spec.rb +8 -8
  64. data/spec/aws/requests/s3/get_bucket_location_spec.rb +4 -4
  65. data/spec/aws/requests/s3/get_bucket_spec.rb +12 -12
  66. data/spec/aws/requests/s3/get_object_spec.rb +9 -9
  67. data/spec/aws/requests/s3/get_request_payment_spec.rb +4 -4
  68. data/spec/aws/requests/s3/get_service_spec.rb +4 -4
  69. data/spec/aws/requests/s3/head_object_spec.rb +5 -5
  70. data/spec/aws/requests/s3/put_bucket_spec.rb +3 -3
  71. data/spec/aws/requests/s3/put_object_spec.rb +11 -11
  72. data/spec/aws/requests/s3/put_request_payment_spec.rb +4 -4
  73. data/spec/aws/requests/simpledb/batch_put_attributes_spec.rb +4 -4
  74. data/spec/aws/requests/simpledb/create_domain_spec.rb +4 -4
  75. data/spec/aws/requests/simpledb/delete_attributes_spec.rb +8 -8
  76. data/spec/aws/requests/simpledb/delete_domain_spec.rb +3 -3
  77. data/spec/aws/requests/simpledb/domain_metadata_spec.rb +6 -6
  78. data/spec/aws/requests/simpledb/get_attributes_spec.rb +9 -9
  79. data/spec/aws/requests/simpledb/list_domains_spec.rb +4 -4
  80. data/spec/aws/requests/simpledb/put_attributes_spec.rb +4 -4
  81. data/spec/compact_progress_bar_formatter.rb +195 -0
  82. data/spec/rackspace/models/servers/server_spec.rb +1 -1
  83. data/spec/rackspace/requests/files/delete_container_spec.rb +3 -3
  84. data/spec/rackspace/requests/files/delete_object_spec.rb +8 -8
  85. data/spec/rackspace/requests/files/get_container_spec.rb +6 -6
  86. data/spec/rackspace/requests/files/get_containers_spec.rb +3 -3
  87. data/spec/rackspace/requests/files/head_container_spec.rb +6 -6
  88. data/spec/rackspace/requests/files/head_containers_spec.rb +3 -3
  89. data/spec/rackspace/requests/files/put_container_spec.rb +2 -2
  90. data/spec/rackspace/requests/files/put_object_spec.rb +4 -4
  91. data/spec/rackspace/requests/servers/create_image_spec.rb +4 -4
  92. data/spec/rackspace/requests/servers/create_server_spec.rb +2 -2
  93. data/spec/rackspace/requests/servers/delete_image_spec.rb +5 -5
  94. data/spec/rackspace/requests/servers/delete_server_spec.rb +3 -3
  95. data/spec/rackspace/requests/servers/get_flavor_details_spec.rb +1 -1
  96. data/spec/rackspace/requests/servers/get_server_details_spec.rb +4 -4
  97. data/spec/rackspace/requests/servers/list_addresses_spec.rb +4 -4
  98. data/spec/rackspace/requests/servers/list_flavors_detail_spec.rb +1 -1
  99. data/spec/rackspace/requests/servers/list_flavors_spec.rb +1 -1
  100. data/spec/rackspace/requests/servers/list_images_detail_spec.rb +1 -1
  101. data/spec/rackspace/requests/servers/list_images_spec.rb +1 -1
  102. data/spec/rackspace/requests/servers/list_private_addresses_spec.rb +4 -4
  103. data/spec/rackspace/requests/servers/list_public_addresses_spec.rb +4 -4
  104. data/spec/rackspace/requests/servers/list_servers_detail_spec.rb +3 -3
  105. data/spec/rackspace/requests/servers/list_servers_spec.rb +3 -3
  106. data/spec/rackspace/requests/servers/reboot_server_spec.rb +4 -4
  107. data/spec/rackspace/requests/servers/update_server_spec.rb +4 -4
  108. data/spec/slicehost/requests/create_slice_spec.rb +2 -2
  109. data/spec/slicehost/requests/delete_slice_spec.rb +2 -2
  110. data/spec/slicehost/requests/get_backups_spec.rb +1 -1
  111. data/spec/slicehost/requests/get_flavors_spec.rb +1 -1
  112. data/spec/slicehost/requests/get_images_spec.rb +1 -1
  113. data/spec/slicehost/requests/get_slices_spec.rb +1 -1
  114. data/spec/spec_helper.rb +60 -38
  115. metadata +16 -3
  116. data/spec/spec.opts +0 -1
@@ -4,15 +4,15 @@ describe 'S3.get_bucket_location' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- s3.put_bucket('foggetlocation', 'LocationConstraint' => 'EU')
7
+ AWS[:s3].put_bucket('foggetlocation', 'LocationConstraint' => 'EU')
8
8
  end
9
9
 
10
10
  after(:each) do
11
- eu_s3.delete_bucket('foggetlocation')
11
+ AWS[:eu_s3].delete_bucket('foggetlocation')
12
12
  end
13
13
 
14
14
  it 'should return proper attributes' do
15
- actual = s3.get_bucket_location('foggetlocation')
15
+ actual = AWS[:s3].get_bucket_location('foggetlocation')
16
16
  actual.status.should == 200
17
17
  actual.body['LocationConstraint'].should == 'EU'
18
18
  end
@@ -22,7 +22,7 @@ describe 'S3.get_bucket_location' do
22
22
 
23
23
  it 'should raise NotFound error if bucket does not exist' do
24
24
  lambda {
25
- s3.get_bucket_location('fognotabucket')
25
+ AWS[:s3].get_bucket_location('fognotabucket')
26
26
  }.should raise_error(Excon::Errors::NotFound)
27
27
  end
28
28
 
@@ -4,19 +4,19 @@ describe 'S3.get_bucket' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- s3.put_bucket('foggetbucket')
8
- s3.put_object('foggetbucket', 'fog_object', lorem_file)
9
- s3.put_object('foggetbucket', 'fog_other_object', lorem_file)
7
+ AWS[:s3].put_bucket('foggetbucket')
8
+ AWS[:s3].put_object('foggetbucket', 'fog_object', lorem_file)
9
+ AWS[:s3].put_object('foggetbucket', 'fog_other_object', lorem_file)
10
10
  end
11
11
 
12
12
  after(:each) do
13
- s3.delete_object('foggetbucket', 'fog_object')
14
- s3.delete_object('foggetbucket', 'fog_other_object')
15
- s3.delete_bucket('foggetbucket')
13
+ AWS[:s3].delete_object('foggetbucket', 'fog_object')
14
+ AWS[:s3].delete_object('foggetbucket', 'fog_other_object')
15
+ AWS[:s3].delete_bucket('foggetbucket')
16
16
  end
17
17
 
18
18
  it 'should return proper attributes' do
19
- actual = s3.get_bucket('foggetbucket')
19
+ actual = AWS[:s3].get_bucket('foggetbucket')
20
20
  actual.body['IsTruncated'].should == false
21
21
  actual.body['Marker'].should be_a(String)
22
22
  actual.body['MaxKeys'].should be_an(Integer)
@@ -36,7 +36,7 @@ describe 'S3.get_bucket' do
36
36
  end
37
37
 
38
38
  it 'should accept marker option' do
39
- actual = s3.get_bucket('foggetbucket', 'marker' => 'fog_object')
39
+ actual = AWS[:s3].get_bucket('foggetbucket', 'marker' => 'fog_object')
40
40
  actual.body['IsTruncated'].should == false
41
41
  actual.body['Marker'].should be_a(String)
42
42
  actual.body['MaxKeys'].should be_an(Integer)
@@ -56,7 +56,7 @@ describe 'S3.get_bucket' do
56
56
  end
57
57
 
58
58
  it 'should respect max-keys option' do
59
- actual = s3.get_bucket('foggetbucket', 'max-keys' => 1)
59
+ actual = AWS[:s3].get_bucket('foggetbucket', 'max-keys' => 1)
60
60
  actual.body['IsTruncated'].should == true
61
61
  actual.body['Marker'].should be_a(String)
62
62
  actual.body['MaxKeys'].should be_an(Integer)
@@ -76,7 +76,7 @@ describe 'S3.get_bucket' do
76
76
  end
77
77
 
78
78
  it 'should accept prefix option' do
79
- actual = s3.get_bucket('foggetbucket', 'prefix' => 'fog_ob')
79
+ actual = AWS[:s3].get_bucket('foggetbucket', 'prefix' => 'fog_ob')
80
80
  actual.body['IsTruncated'].should == false
81
81
  actual.body['Marker'].should be_a(String)
82
82
  actual.body['MaxKeys'].should be_an(Integer)
@@ -100,13 +100,13 @@ describe 'S3.get_bucket' do
100
100
 
101
101
  it 'should raise a NotFound error if the bucket does not exist' do
102
102
  lambda {
103
- s3.get_bucket('fognotabucket')
103
+ AWS[:s3].get_bucket('fognotabucket')
104
104
  }.should raise_error(Excon::Errors::NotFound)
105
105
  end
106
106
 
107
107
  it 'should request non-subdomain buckets and raise a NotFound error' do
108
108
  lambda {
109
- s3.get_bucket('A-invalid--name')
109
+ AWS[:s3].get_bucket('A-invalid--name')
110
110
  }.should raise_error(Excon::Errors::NotFound)
111
111
  end
112
112
 
@@ -4,17 +4,17 @@ describe 'S3.get_object' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- s3.put_bucket('foggetobject')
8
- s3.put_object('foggetobject', 'fog_get_object', lorem_file)
7
+ AWS[:s3].put_bucket('foggetobject')
8
+ AWS[:s3].put_object('foggetobject', 'fog_get_object', lorem_file)
9
9
  end
10
10
 
11
11
  after(:each) do
12
- s3.delete_object('foggetobject', 'fog_get_object')
13
- s3.delete_bucket('foggetobject')
12
+ AWS[:s3].delete_object('foggetobject', 'fog_get_object')
13
+ AWS[:s3].delete_bucket('foggetobject')
14
14
  end
15
15
 
16
16
  it 'should return proper attributes' do
17
- actual = s3.get_object('foggetobject', 'fog_get_object')
17
+ actual = AWS[:s3].get_object('foggetobject', 'fog_get_object')
18
18
  actual.status.should == 200
19
19
  data = lorem_file.read
20
20
  actual.body.should == data
@@ -26,14 +26,14 @@ describe 'S3.get_object' do
26
26
 
27
27
  it 'should return chunks with optional block' do
28
28
  data = ''
29
- s3.get_object('foggetobject', 'fog_get_object') do |chunk|
29
+ AWS[:s3].get_object('foggetobject', 'fog_get_object') do |chunk|
30
30
  data << chunk
31
31
  end
32
32
  data.should == lorem_file.read
33
33
  end
34
34
 
35
35
  it 'should return a signed expiring url' do
36
- url = s3.get_object_url('foggetobject', 'fog_get_object', Time.now + 60 * 10)
36
+ url = AWS[:s3].get_object_url('foggetobject', 'fog_get_object', Time.now + 60 * 10)
37
37
  unless Fog.mocking?
38
38
  open(url).read.should == lorem_file.read
39
39
  end
@@ -44,13 +44,13 @@ describe 'S3.get_object' do
44
44
 
45
45
  it 'should raise a NotFound error if the bucket does not exist' do
46
46
  lambda {
47
- s3.get_object('fognotabucket', 'fog_get_object')
47
+ AWS[:s3].get_object('fognotabucket', 'fog_get_object')
48
48
  }.should raise_error(Excon::Errors::NotFound)
49
49
  end
50
50
 
51
51
  it 'should raise a NotFound error if the object does not exist' do
52
52
  lambda {
53
- s3.get_object('foggetobject', 'fog_not_an_object')
53
+ AWS[:s3].get_object('foggetobject', 'fog_not_an_object')
54
54
  }.should raise_error(Excon::Errors::NotFound)
55
55
  end
56
56
 
@@ -4,15 +4,15 @@ describe 'S3.get_request_payment' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- s3.put_bucket('foggetrequestpayment')
7
+ AWS[:s3].put_bucket('foggetrequestpayment')
8
8
  end
9
9
 
10
10
  after(:each) do
11
- s3.delete_bucket('foggetrequestpayment')
11
+ AWS[:s3].delete_bucket('foggetrequestpayment')
12
12
  end
13
13
 
14
14
  it 'should return proper attributes' do
15
- actual = s3.get_request_payment('foggetrequestpayment')
15
+ actual = AWS[:s3].get_request_payment('foggetrequestpayment')
16
16
  actual.status.should == 200
17
17
  actual.body['Payer'].should == 'BucketOwner'
18
18
  end
@@ -22,7 +22,7 @@ describe 'S3.get_request_payment' do
22
22
 
23
23
  it 'should raise a NotFound error if the bucket does not exist' do
24
24
  lambda {
25
- s3.get_request_payment('fognotabucket')
25
+ AWS[:s3].get_request_payment('fognotabucket')
26
26
  }.should raise_error(Excon::Errors::NotFound)
27
27
  end
28
28
 
@@ -4,15 +4,15 @@ describe 'S3.get_service' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- s3.put_bucket('foggetservice')
7
+ AWS[:s3].put_bucket('foggetservice')
8
8
  end
9
9
 
10
10
  after(:each) do
11
- s3.delete_bucket('foggetservice')
11
+ AWS[:s3].delete_bucket('foggetservice')
12
12
  end
13
13
 
14
14
  it 'should return proper_attributes' do
15
- actual = s3.get_service
15
+ actual = AWS[:s3].get_service
16
16
  actual.body['Buckets'].should be_an(Array)
17
17
  bucket = actual.body['Buckets'].select {|bucket| bucket['Name'] == 'foggetservice'}.first
18
18
  bucket['CreationDate'].should be_a(Time)
@@ -24,7 +24,7 @@ describe 'S3.get_service' do
24
24
 
25
25
  it 'should include foggetservice in get_service' do
26
26
  eventually do
27
- actual = s3.get_service
27
+ actual = AWS[:s3].get_service
28
28
  actual.body['Buckets'].collect { |bucket| bucket['Name'] }.should include('foggetservice')
29
29
  end
30
30
  end
@@ -4,17 +4,17 @@ describe 'S3.head_object' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- s3.put_bucket('fogheadobject')
8
- s3.put_object('fogheadobject', 'fog_head_object', lorem_file)
7
+ AWS[:s3].put_bucket('fogheadobject')
8
+ AWS[:s3].put_object('fogheadobject', 'fog_head_object', lorem_file)
9
9
  end
10
10
 
11
11
  after(:each) do
12
- s3.delete_object('fogheadobject', 'fog_head_object')
13
- s3.delete_bucket('fogheadobject')
12
+ AWS[:s3].delete_object('fogheadobject', 'fog_head_object')
13
+ AWS[:s3].delete_bucket('fogheadobject')
14
14
  end
15
15
 
16
16
  it 'should return proper attributes' do
17
- actual = s3.head_object('fogheadobject', 'fog_head_object')
17
+ actual = AWS[:s3].head_object('fogheadobject', 'fog_head_object')
18
18
  actual.status.should == 200
19
19
  data = lorem_file.read
20
20
  actual.headers['Content-Length'].should == data.length.to_s
@@ -4,15 +4,15 @@ describe 'S3.put_bucket' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- @response = s3.put_bucket('fogputbucket')
7
+ @response = AWS[:s3].put_bucket('fogputbucket')
8
8
  end
9
9
 
10
10
  after(:each) do
11
- s3.delete_bucket('fogputbucket')
11
+ AWS[:s3].delete_bucket('fogputbucket')
12
12
  end
13
13
 
14
14
  it 'should not raise an error if the bucket already exists' do
15
- s3.put_bucket('fogputbucket')
15
+ AWS[:s3].put_bucket('fogputbucket')
16
16
  end
17
17
 
18
18
  end
@@ -4,13 +4,13 @@ describe 'S3.put_object' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- s3.put_bucket('fogputobject')
8
- @response = s3.put_object('fogputobject', 'fog_put_object', lorem_file)
7
+ AWS[:s3].put_bucket('fogputobject')
8
+ @response = AWS[:s3].put_object('fogputobject', 'fog_put_object', lorem_file)
9
9
  end
10
10
 
11
11
  after(:each) do
12
- s3.delete_object('fogputobject', 'fog_put_object')
13
- s3.delete_bucket('fogputobject')
12
+ AWS[:s3].delete_object('fogputobject', 'fog_put_object')
13
+ AWS[:s3].delete_bucket('fogputobject')
14
14
  end
15
15
 
16
16
  it 'should return proper attributes' do
@@ -18,7 +18,7 @@ describe 'S3.put_object' do
18
18
  end
19
19
 
20
20
  it 'should not raise an error if the object already exists' do
21
- actual = s3.put_object('fogputobject', 'fog_put_object', lorem_file)
21
+ actual = AWS[:s3].put_object('fogputobject', 'fog_put_object', lorem_file)
22
22
  actual.status.should == 200
23
23
  end
24
24
 
@@ -27,16 +27,16 @@ describe 'S3.put_object' do
27
27
 
28
28
  it 'should raise a NotFound error if the bucket does not exist' do
29
29
  lambda {
30
- s3.put_object('fognotabucket', 'fog_put_object', lorem_file)
30
+ AWS[:s3].put_object('fognotabucket', 'fog_put_object', lorem_file)
31
31
  }.should raise_error(Excon::Errors::NotFound)
32
32
  end
33
33
 
34
34
  it 'should not raise an error if the object already exists' do
35
- s3.put_bucket('fogputobject')
36
- s3.put_object('fogputobject', 'fog_put_object', lorem_file)
37
- s3.put_object('fogputobject', 'fog_put_object', lorem_file)
38
- s3.delete_object('fogputobject', 'fog_put_object')
39
- s3.delete_bucket('fogputobject')
35
+ AWS[:s3].put_bucket('fogputobject')
36
+ AWS[:s3].put_object('fogputobject', 'fog_put_object', lorem_file)
37
+ AWS[:s3].put_object('fogputobject', 'fog_put_object', lorem_file)
38
+ AWS[:s3].delete_object('fogputobject', 'fog_put_object')
39
+ AWS[:s3].delete_bucket('fogputobject')
40
40
  end
41
41
 
42
42
  end
@@ -4,15 +4,15 @@ describe 'S3.put_request_payment' do
4
4
  describe 'success' do
5
5
 
6
6
  before(:each) do
7
- s3.put_bucket('fogputrequestpayment')
7
+ AWS[:s3].put_bucket('fogputrequestpayment')
8
8
  end
9
9
 
10
10
  after(:each) do
11
- s3.delete_bucket('fogputrequestpayment')
11
+ AWS[:s3].delete_bucket('fogputrequestpayment')
12
12
  end
13
13
 
14
14
  it 'should return proper attributes' do
15
- actual = s3.put_request_payment('fogputrequestpayment', 'Requester')
15
+ actual = AWS[:s3].put_request_payment('fogputrequestpayment', 'Requester')
16
16
  actual.status.should == 200
17
17
  end
18
18
 
@@ -21,7 +21,7 @@ describe 'S3.put_request_payment' do
21
21
 
22
22
  it 'should raise a NotFound error if bucket does not exist' do
23
23
  lambda {
24
- s3.put_request_payment('fognotabucket', 'Requester')
24
+ AWS[:s3].put_request_payment('fognotabucket', 'Requester')
25
25
  }.should raise_error(Excon::Errors::NotFound)
26
26
  end
27
27
 
@@ -5,15 +5,15 @@ describe 'SimpleDB.batch_put_attributes' do
5
5
 
6
6
  before(:all) do
7
7
  @domain_name = "fog_domain_#{Time.now.to_i}"
8
- sdb.create_domain(@domain_name)
8
+ AWS[:sdb].create_domain(@domain_name)
9
9
  end
10
10
 
11
11
  after(:all) do
12
- sdb.delete_domain(@domain_name)
12
+ AWS[:sdb].delete_domain(@domain_name)
13
13
  end
14
14
 
15
15
  it 'should return proper attributes' do
16
- actual = sdb.batch_put_attributes(@domain_name, { 'a' => { 'b' => 'c' }, 'x' => { 'y' => 'z' } })
16
+ actual = AWS[:sdb].batch_put_attributes(@domain_name, { 'a' => { 'b' => 'c' }, 'x' => { 'y' => 'z' } })
17
17
  actual.body['RequestId'].should be_a(String)
18
18
  actual.body['BoxUsage'].should be_a(Float)
19
19
  end
@@ -23,7 +23,7 @@ describe 'SimpleDB.batch_put_attributes' do
23
23
 
24
24
  it 'should raise a BadRequest error if the domain does not exist' do
25
25
  lambda {
26
- sdb.batch_put_attributes('notadomain', { 'a' => { 'b' => 'c' }, 'x' => { 'y' => 'z' } })
26
+ AWS[:sdb].batch_put_attributes('notadomain', { 'a' => { 'b' => 'c' }, 'x' => { 'y' => 'z' } })
27
27
  }.should raise_error(Excon::Errors::BadRequest)
28
28
  end
29
29
 
@@ -6,13 +6,13 @@ describe 'SimpleDB.create_domain' do
6
6
  end
7
7
 
8
8
  after(:each) do
9
- sdb.delete_domain(@domain_name)
9
+ AWS[:sdb].delete_domain(@domain_name)
10
10
  end
11
11
 
12
12
  describe 'success' do
13
13
 
14
14
  it 'should return proper attributes' do
15
- actual = sdb.create_domain(@domain_name)
15
+ actual = AWS[:sdb].create_domain(@domain_name)
16
16
  actual.body['RequestId'].should be_a(String)
17
17
  actual.body['BoxUsage'].should be_a(Float)
18
18
  end
@@ -21,8 +21,8 @@ describe 'SimpleDB.create_domain' do
21
21
  describe 'failure' do
22
22
 
23
23
  it 'should not raise an error if the domain already exists' do
24
- sdb.create_domain(@domain_name)
25
- sdb.create_domain(@domain_name)
24
+ AWS[:sdb].create_domain(@domain_name)
25
+ AWS[:sdb].create_domain(@domain_name)
26
26
  end
27
27
 
28
28
  end
@@ -5,16 +5,16 @@ describe 'SimpleDB.delete_attributes' do
5
5
 
6
6
  before(:each) do
7
7
  @domain_name = "fog_domain_#{Time.now.to_i}"
8
- sdb.create_domain(@domain_name)
9
- sdb.put_attributes(@domain_name, 'foo', { :bar => :baz })
8
+ AWS[:sdb].create_domain(@domain_name)
9
+ AWS[:sdb].put_attributes(@domain_name, 'foo', { :bar => :baz })
10
10
  end
11
11
 
12
12
  after(:each) do
13
- sdb.delete_domain(@domain_name)
13
+ AWS[:sdb].delete_domain(@domain_name)
14
14
  end
15
15
 
16
16
  it 'should return proper attributes from delete_attributes' do
17
- actual = sdb.delete_attributes(@domain_name, 'foo')
17
+ actual = AWS[:sdb].delete_attributes(@domain_name, 'foo')
18
18
  actual.body['RequestId'].should be_a(String)
19
19
  actual.body['BoxUsage'].should be_a(Float)
20
20
  end
@@ -24,15 +24,15 @@ describe 'SimpleDB.delete_attributes' do
24
24
 
25
25
  it 'shouild raise a BadRequest error if the domain does not exist' do
26
26
  lambda {
27
- sdb.delete_attributes('notadomain', 'notanattribute')
27
+ AWS[:sdb].delete_attributes('notadomain', 'notanattribute')
28
28
  }.should raise_error(Excon::Errors::BadRequest)
29
29
  end
30
30
 
31
31
  it 'should not raise an error if the attribute does not exist' do
32
32
  @domain_name = "fog_domain_#{Time.now.to_i}"
33
- sdb.create_domain(@domain_name)
34
- sdb.delete_attributes(@domain_name, 'notanattribute')
35
- sdb.delete_domain(@domain_name)
33
+ AWS[:sdb].create_domain(@domain_name)
34
+ AWS[:sdb].delete_attributes(@domain_name, 'notanattribute')
35
+ AWS[:sdb].delete_domain(@domain_name)
36
36
  end
37
37
 
38
38
  end
@@ -8,11 +8,11 @@ describe 'SimpleDB.delete_domain' do
8
8
  end
9
9
 
10
10
  before(:each) do
11
- sdb.create_domain(@domain_name)
11
+ AWS[:sdb].create_domain(@domain_name)
12
12
  end
13
13
 
14
14
  it 'should return proper attributes' do
15
- actual = sdb.delete_domain(@domain_name)
15
+ actual = AWS[:sdb].delete_domain(@domain_name)
16
16
  actual.body['RequestId'].should be_a(String)
17
17
  actual.body['BoxUsage'].should be_a(Float)
18
18
  end
@@ -21,7 +21,7 @@ describe 'SimpleDB.delete_domain' do
21
21
  describe 'failure' do
22
22
 
23
23
  it 'should not raise an error if the domain does not exist' do
24
- sdb.delete_domain('notadomain')
24
+ AWS[:sdb].delete_domain('notadomain')
25
25
  end
26
26
 
27
27
  end