raws 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,6 +44,21 @@ class RAWS::SQS::Adapter
44
44
  params
45
45
  end
46
46
 
47
+ def pack_permission(params)
48
+ ret = {}
49
+
50
+ i = 1
51
+ params.each do |id, permissions|
52
+ permissions.each do |permission|
53
+ ret["AWSAccountId.#{i}"] = id
54
+ ret["ActionName.#{i}"] = permission
55
+ i += 1
56
+ end
57
+ end
58
+
59
+ ret
60
+ end
61
+
47
62
  def sign(method, base_uri, params)
48
63
  path = {
49
64
  'AWSAccessKeyId' => RAWS.aws_access_key_id,
@@ -81,12 +96,15 @@ class RAWS::SQS::Adapter
81
96
  doc
82
97
  end
83
98
 
84
- def create_queue(queue_name, timeout=nil)
99
+ def create_queue(queue_name, default_visibility_timeout=nil)
85
100
  params = {
86
101
  'Action' => 'CreateQueue',
87
102
  'QueueName' => queue_name
88
103
  }
89
- params['DefaultVisibilityTimeout'] = timeout if timeout
104
+
105
+ if default_visibility_timeout
106
+ params['DefaultVisibilityTimeout'] = default_visibility_timeout
107
+ end
90
108
 
91
109
  connect('GET', URI, PARAMS.merge(params))
92
110
  end
@@ -121,7 +139,7 @@ class RAWS::SQS::Adapter
121
139
  )
122
140
  end
123
141
 
124
- def set_queue_attributes(queue_url, attrs={})
142
+ def set_queue_attributes(queue_url, attrs)
125
143
  params = {'Action' => 'SetQueueAttributes'}
126
144
  params.merge!(pack_nv_attrs(attrs))
127
145
 
@@ -137,11 +155,9 @@ class RAWS::SQS::Adapter
137
155
  connect('GET', queue_url, PARAMS.merge(params))
138
156
  end
139
157
 
140
- def receive_message(queue_url, limit=nil, timeout=nil, *attrs)
141
- params = {'Action' => 'ReceiveMessage'}
142
- params['MaxNumberOfMessages'] = limit if limit
143
- params['VisibilityTimeout'] = timeout if timeout
144
- params.merge!(pack_attrs(attrs))
158
+ def receive_message(queue_url, params={}, *attrs)
159
+ params.merge! 'Action' => 'ReceiveMessage'
160
+ params.merge! pack_attrs(attrs)
145
161
 
146
162
  connect(
147
163
  'GET',
@@ -152,11 +168,11 @@ class RAWS::SQS::Adapter
152
168
  )
153
169
  end
154
170
 
155
- def change_message_visibility(queue_url, receipt_handle, timeout)
171
+ def change_message_visibility(queue_url, receipt_handle, visibility_timeout)
156
172
  params = {
157
173
  'Action' => 'ChangeMessageVisibility',
158
174
  'ReceiptHandle' => receipt_handle,
159
- 'VisibilityTimeout' => timeout
175
+ 'VisibilityTimeout' => visibility_timeout
160
176
  }
161
177
 
162
178
  connect('GET', queue_url, PARAMS.merge(params))
@@ -171,27 +187,12 @@ class RAWS::SQS::Adapter
171
187
  connect('GET', queue_url, PARAMS.merge(params))
172
188
  end
173
189
 
174
- def pack_permission(params)
175
- ret = {}
176
-
177
- i = 1
178
- params.each do |id, permissions|
179
- permissions.each do |permission|
180
- ret["AWSAccountId.#{i}"] = id
181
- ret["ActionName.#{i}"] = permission
182
- i += 1
183
- end
184
- end
185
-
186
- ret
187
- end
188
-
189
- def add_permission(queue_url, label, permission)
190
+ def add_permission(queue_url, label, permissions)
190
191
  params = {
191
192
  'Action' => 'AddPermission',
192
193
  'Label' => label
193
194
  }
194
- params.merge!(pack_permission(permission))
195
+ params.merge!(pack_permission(permissions))
195
196
 
196
197
  connect('GET', queue_url, PARAMS.merge(params))
197
198
  end
@@ -0,0 +1,39 @@
1
+ class RAWS::SQS::Message
2
+ attr_reader :queue
3
+ attr_reader :data
4
+
5
+ def initialize(queue, data)
6
+ @queue, @data = queue, data
7
+ end
8
+
9
+ def message_id
10
+ data['MessageId']
11
+ end
12
+ alias :id :message_id
13
+
14
+ def receipt_handle
15
+ data['ReceiptHandle']
16
+ end
17
+
18
+ def md5_of_body
19
+ data['MD5OfBody']
20
+ end
21
+
22
+ def attributes
23
+ data['Attribute']
24
+ end
25
+ alias :attrs :attributes
26
+
27
+ def body
28
+ data['Body']
29
+ end
30
+
31
+ def change_visibility(visibility_timeout)
32
+ queue.change_message_visibility receipt_handle, visibility_timeout
33
+ end
34
+ alias :visibility= :change_visibility
35
+
36
+ def delete
37
+ queue.delete_message receipt_handle
38
+ end
39
+ end
@@ -0,0 +1,33 @@
1
+ require 'forwardable'
2
+
3
+ module RAWS::SQS::Model
4
+ module ClassMethods
5
+ extend Forwardable
6
+ def_delegators :queue,
7
+ :delete_queue,
8
+ :get_queue_attributes,
9
+ :set_queue_attributes,
10
+ :send_message,
11
+ :send,
12
+ :receive_message,
13
+ :receive,
14
+ :add_permission,
15
+ :remove_permission
16
+
17
+ attr_accessor :queue_name
18
+
19
+ def queue
20
+ RAWS::SQS[self.queue_name]
21
+ end
22
+
23
+ def create_queue
24
+ RAWS::SQS.create_queue(self.queue_name)
25
+ end
26
+ end
27
+
28
+ def self.included(mod)
29
+ mod.class_eval do
30
+ extend ClassMethods
31
+ end
32
+ end
33
+ end
data/lib/raws/xml.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'nokogiri'
2
-
3
1
  module RAWS
4
2
  module XML
5
3
  def self.unpack_attrs(attrs)
@@ -19,7 +19,10 @@ module RAWS
19
19
  end
20
20
  end
21
21
 
22
- if tag.child.is_a? ::Nokogiri::XML::Text
22
+ case tag.child
23
+ when nil
24
+ ret[name] = nil
25
+ when ::Nokogiri::XML::Text
23
26
  if ret.key? name
24
27
  ret[name] << tag.content
25
28
  else
data/raws.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{raws}
8
- s.version = "0.0.10"
8
+ s.version = "0.0.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jun Kikuchi"]
12
- s.date = %q{2009-11-23}
12
+ s.date = %q{2010-01-25}
13
13
  s.description = %q{raws}
14
14
  s.email = %q{kikuchi@bonnou.com}
15
15
  s.extra_rdoc_files = [
@@ -28,25 +28,29 @@ Gem::Specification.new do |s|
28
28
  "lib/raws/http/ht2p.rb",
29
29
  "lib/raws/http/typhoeus.rb",
30
30
  "lib/raws/s3.rb",
31
+ "lib/raws/s3/acl.rb",
31
32
  "lib/raws/s3/adapter.rb",
32
33
  "lib/raws/s3/metadata.rb",
33
34
  "lib/raws/s3/model.rb",
35
+ "lib/raws/s3/owner.rb",
34
36
  "lib/raws/sdb.rb",
35
37
  "lib/raws/sdb/adapter.rb",
36
38
  "lib/raws/sdb/model.rb",
37
39
  "lib/raws/sdb/select.rb",
38
40
  "lib/raws/sqs.rb",
39
41
  "lib/raws/sqs/adapter.rb",
42
+ "lib/raws/sqs/message.rb",
43
+ "lib/raws/sqs/model.rb",
40
44
  "lib/raws/xml.rb",
41
45
  "lib/raws/xml/nokogiri.rb",
42
46
  "raws.gemspec",
47
+ "spec/raws/s3/acl_spec.rb",
43
48
  "spec/raws/s3/model_spec.rb",
44
49
  "spec/raws/s3_spec.rb",
45
50
  "spec/raws/sdb/model_spec.rb",
46
51
  "spec/raws/sdb_spec.rb",
47
52
  "spec/raws/sqs_spec.rb",
48
53
  "spec/raws_spec.rb",
49
- "spec/spec.opts",
50
54
  "spec/spec_config.rb.example",
51
55
  "spec/spec_helper.rb"
52
56
  ]
@@ -56,7 +60,8 @@ Gem::Specification.new do |s|
56
60
  s.rubygems_version = %q{1.3.5}
57
61
  s.summary = %q{raws}
58
62
  s.test_files = [
59
- "spec/raws/s3/model_spec.rb",
63
+ "spec/raws/s3/acl_spec.rb",
64
+ "spec/raws/s3/model_spec.rb",
60
65
  "spec/raws/s3_spec.rb",
61
66
  "spec/raws/sdb/model_spec.rb",
62
67
  "spec/raws/sdb_spec.rb",
@@ -70,24 +75,24 @@ Gem::Specification.new do |s|
70
75
  s.specification_version = 3
71
76
 
72
77
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
73
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
74
- s.add_runtime_dependency(%q<typhoeus>, [">= 0.1.9"])
75
- s.add_runtime_dependency(%q<ht2p>, [">= 0.0.5"])
76
- s.add_runtime_dependency(%q<nokogiri>, [">= 1.3.3"])
77
- s.add_runtime_dependency(%q<uuidtools>, [">= 2.0.0"])
78
+ s.add_development_dependency(%q<rspec>, [">= 0"])
79
+ s.add_runtime_dependency(%q<typhoeus>, [">= 0.1.14"])
80
+ s.add_runtime_dependency(%q<ht2p>, [">= 0.0.7"])
81
+ s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.1"])
82
+ s.add_runtime_dependency(%q<uuidtools>, [">= 2.1.1"])
78
83
  else
79
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
80
- s.add_dependency(%q<typhoeus>, [">= 0.1.9"])
81
- s.add_dependency(%q<ht2p>, [">= 0.0.5"])
82
- s.add_dependency(%q<nokogiri>, [">= 1.3.3"])
83
- s.add_dependency(%q<uuidtools>, [">= 2.0.0"])
84
+ s.add_dependency(%q<rspec>, [">= 0"])
85
+ s.add_dependency(%q<typhoeus>, [">= 0.1.14"])
86
+ s.add_dependency(%q<ht2p>, [">= 0.0.7"])
87
+ s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
88
+ s.add_dependency(%q<uuidtools>, [">= 2.1.1"])
84
89
  end
85
90
  else
86
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
87
- s.add_dependency(%q<typhoeus>, [">= 0.1.9"])
88
- s.add_dependency(%q<ht2p>, [">= 0.0.5"])
89
- s.add_dependency(%q<nokogiri>, [">= 1.3.3"])
90
- s.add_dependency(%q<uuidtools>, [">= 2.0.0"])
91
+ s.add_dependency(%q<rspec>, [">= 0"])
92
+ s.add_dependency(%q<typhoeus>, [">= 0.1.14"])
93
+ s.add_dependency(%q<ht2p>, [">= 0.0.7"])
94
+ s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
95
+ s.add_dependency(%q<uuidtools>, [">= 2.1.1"])
91
96
  end
92
97
  end
93
98
 
@@ -0,0 +1,30 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe RAWS::S3::ACL::Grants do
4
+ before :all do
5
+ acp = '<AccessControlPolicy><Owner><ID>a9a7b886d6fd24a52fe8ca5bef65f89a64e0193f23000e241bf9b1c61be666e9</ID><DisplayName>chriscustomer</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>a9a7b886d6fd24a52fe8ca5bef65f89a64e0193f23000e241bf9b1c61be666e9</ID><DisplayName>chriscustomer</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be</ID><DisplayName>Frank</DisplayName></Grantee><Permission>WRITE</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be</ID><DisplayName>Frank</DisplayName></Grantee><Permission>READ_ACP</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>e019164ebb0724ff67188e243eae9ccbebdde523717cc312255d9a82498e394a</ID><DisplayName>Jose</DisplayName></Grantee><Permission>WRITE</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>e019164ebb0724ff67188e243eae9ccbebdde523717cc312255d9a82498e394a</ID><DisplayName>Jose</DisplayName></Grantee><Permission>READ_ACP</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>http://acs.amazonaws.com/groups/global/AllUsers</URI></Grantee><Permission>READ</Permission></Grant></AccessControlList></AccessControlPolicy>'
6
+
7
+ @grants = RAWS::S3::ACL::Grants.new(
8
+ RAWS.xml.parse(
9
+ acp,
10
+ :multiple => ['Grant']
11
+ )['AccessControlPolicy']['AccessControlList']['Grant']
12
+ )
13
+ end
14
+
15
+ it 'grants should return array of grant' do
16
+ @grants.should be_instance_of RAWS::S3::ACL::Grants
17
+
18
+ @grants[0].should be_instance_of RAWS::S3::ACL::ID
19
+ @grants[0].id.should == 'a9a7b886d6fd24a52fe8ca5bef65f89a64e0193f23000e241bf9b1c61be666e9'
20
+ @grants[0].name.should == 'chriscustomer'
21
+ @grants[0].permission.should == 'FULL_CONTROL'
22
+
23
+ @grants.last.should be_instance_of RAWS::S3::ACL::AllUsers
24
+ @grants.last.permission.should == 'READ'
25
+ end
26
+
27
+ it 'to_xml should return access controll policy' do
28
+ @grants.to_xml.should == "<AccessControlList><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>a9a7b886d6fd24a52fe8ca5bef65f89a64e0193f23000e241bf9b1c61be666e9</ID><DisplayName>chriscustomer</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be</ID><DisplayName>Frank</DisplayName></Grantee><Permission>WRITE</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be</ID><DisplayName>Frank</DisplayName></Grantee><Permission>READ_ACP</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>e019164ebb0724ff67188e243eae9ccbebdde523717cc312255d9a82498e394a</ID><DisplayName>Jose</DisplayName></Grantee><Permission>WRITE</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>e019164ebb0724ff67188e243eae9ccbebdde523717cc312255d9a82498e394a</ID><DisplayName>Jose</DisplayName></Grantee><Permission>READ_ACP</Permission></Grant><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Group\"><URI>http://acs.amazonaws.com/groups/global/AllUsers</URI></Grantee><Permission>READ</Permission></Grant></AccessControlList>"
29
+ end
30
+ end
@@ -1,4 +1,4 @@
1
- require 'spec/spec_config'
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
2
 
3
3
  class S3Object
4
4
  include RAWS::S3::Model
@@ -22,7 +22,7 @@ describe RAWS::S3::Model do
22
22
 
23
23
  describe 'object' do
24
24
  before do
25
- @model = S3Object.all.first
25
+ @model = S3Object.new('a')
26
26
  end
27
27
 
28
28
  it 'methods' do
@@ -37,4 +37,3 @@ describe RAWS::S3::Model do
37
37
  end
38
38
  end
39
39
  end
40
-
data/spec/raws/s3_spec.rb CHANGED
@@ -8,24 +8,25 @@ RAWS_S3_BUCKETS.each do |bucket_name, location, acl|
8
8
  describe RAWS::S3 do
9
9
  describe 'class' do
10
10
  before(:all) do
11
- #response = RAWS::S3.create_bucket(bucket_name, location)
12
- #response.should be_kind_of(RAWS::HTTP::Response)
13
-
11
+ =begin
12
+ response = RAWS::S3.create_bucket(bucket_name, location)
13
+ response.should be_kind_of(RAWS::HTTP::Response)
14
+ =end
14
15
  begin
15
- RAWS::S3.put(bucket_name, 'aaa') do |request|
16
+ RAWS::S3.put_object(bucket_name, 'aaa') do |request|
16
17
  request.send 'AAA'
17
18
  end
18
19
 
19
- RAWS::S3.put(bucket_name, 'bbb') do |request|
20
- request.header['content-length'] = 3
21
- request.send do |io|
22
- io.write 'BBB'
20
+ RAWS::S3.put_object(bucket_name, 'bbb') do |request|
21
+ request.header['content-length'] = 3
22
+ request.send do |io|
23
+ io.write 'BBB'
24
+ end
23
25
  end
24
- end
25
26
 
26
- RAWS::S3.put(bucket_name, 'ccc') do |request|
27
- request.send 'CCC'
28
- end
27
+ RAWS::S3.put_object(bucket_name, 'ccc') do |request|
28
+ request.send 'CCC'
29
+ end
29
30
  rescue => e
30
31
  d e
31
32
  end
@@ -39,17 +40,16 @@ RAWS_S3_BUCKETS.each do |bucket_name, location, acl|
39
40
  end
40
41
  =end
41
42
  it "owner should return a owner information of the bucket" do
42
- RAWS::S3.owner.should be_instance_of(Hash)
43
- RAWS::S3.owner['DisplayName'].should be_instance_of(String)
44
- RAWS::S3.owner['ID'].should be_instance_of(String)
43
+ RAWS::S3.owner.should be_instance_of(RAWS::S3::Owner)
44
+ RAWS::S3.owner.display_name.should be_instance_of(String)
45
+ RAWS::S3.owner.id.should be_instance_of(String)
45
46
  end
46
47
 
47
48
  it "buckets should return an array of RAWS::S3" do
48
- RAWS::S3.buckets.should be_instance_of(Array)
49
- RAWS::S3.buckets.each do |bucket|
49
+ RAWS::S3.list_buckets.should be_instance_of(Array)
50
+ RAWS::S3.list_buckets.each do |bucket|
50
51
  bucket.should be_instance_of(RAWS::S3)
51
52
  end
52
- RAWS::S3.buckets.should include(RAWS::S3[bucket_name])
53
53
  end
54
54
 
55
55
  it "self['#{bucket_name}'] should be instance of RAWS::S3" do
@@ -66,15 +66,14 @@ RAWS_S3_BUCKETS.each do |bucket_name, location, acl|
66
66
  end
67
67
  end
68
68
 
69
- it "filter('#{bucket_name}') should return an array of RAWS::HTTP::Response" do
70
- RAWS::S3.filter(bucket_name).should be_instance_of(Array)
71
- RAWS::S3.filter(bucket_name).each do |object|
69
+ it "filter('#{bucket_name}')" do
70
+ RAWS::S3.filter(bucket_name) do |object|
72
71
  object.should be_instance_of(Hash)
73
72
  end
74
73
  end
75
74
 
76
- it 'put, get and delete method should put, get and delete the object' do
77
- RAWS::S3.put(bucket_name, 'a') do |request|
75
+ it 'put_object, get_object and delete_object method should put, get and delete the object' do
76
+ RAWS::S3.put_object(bucket_name, 'a') do |request|
78
77
  request.should be_kind_of(RAWS::HTTP::Request)
79
78
 
80
79
  response = request.send('AAA')
@@ -82,7 +81,7 @@ RAWS_S3_BUCKETS.each do |bucket_name, location, acl|
82
81
  response.should be_kind_of(RAWS::HTTP::Response)
83
82
  end
84
83
 
85
- RAWS::S3.get(bucket_name, 'a') do |request|
84
+ RAWS::S3.get_object(bucket_name, 'a') do |request|
86
85
  request.should be_kind_of(RAWS::HTTP::Request)
87
86
 
88
87
  response = request.send
@@ -91,36 +90,36 @@ RAWS_S3_BUCKETS.each do |bucket_name, location, acl|
91
90
  response.should be_kind_of(RAWS::HTTP::Response)
92
91
  end
93
92
 
94
- response = RAWS::S3.delete(bucket_name, 'a')
93
+ response = RAWS::S3.delete_object(bucket_name, 'a')
95
94
  response.should be_kind_of(RAWS::HTTP::Response)
96
95
 
97
96
  lambda do
98
- RAWS::S3.get(bucket_name, 'a')
97
+ RAWS::S3.get_object(bucket_name, 'a')
99
98
  end.should raise_error(RAWS::HTTP::Error)
100
99
  end
101
100
 
102
- it "copy method should copy the object" do
103
- response = RAWS::S3.copy(bucket_name, 'aaa', bucket_name, 'AAA')
101
+ it "copy_object method should copy the object" do
102
+ response = RAWS::S3.copy_object(bucket_name, 'aaa', bucket_name, 'AAA')
104
103
  response.should be_kind_of(RAWS::HTTP::Response)
105
104
 
106
105
  src = nil
107
- RAWS::S3.get(bucket_name, 'aaa') do |request|
106
+ RAWS::S3.get_object(bucket_name, 'aaa') do |request|
108
107
  src = request.send.receive
109
108
  end
110
109
 
111
110
  dest = nil
112
- RAWS::S3.get(bucket_name, 'AAA') do |request|
111
+ RAWS::S3.get_object(bucket_name, 'AAA') do |request|
113
112
  dest = request.send.receive
114
113
  end
115
114
 
116
115
  dest.should == src
117
116
 
118
- response = RAWS::S3.delete(bucket_name, 'AAA')
117
+ response = RAWS::S3.delete_object(bucket_name, 'AAA')
119
118
  response.should be_kind_of(RAWS::HTTP::Response)
120
119
  end
121
120
 
122
- it "head method should return header information of the object" do
123
- response = RAWS::S3.head(bucket_name, 'aaa')
121
+ it "head_object method should return header information of the object" do
122
+ response = RAWS::S3.head_object(bucket_name, 'aaa')
124
123
  response.should be_kind_of(RAWS::HTTP::Response)
125
124
  end
126
125
  end
@@ -151,9 +150,8 @@ RAWS_S3_BUCKETS.each do |bucket_name, location, acl|
151
150
  @bucket.location.should == location_label
152
151
  end
153
152
 
154
- it "filter should return an array of RAWS::HTTP::Response" do
155
- @bucket.filter.should be_instance_of(Array)
156
- @bucket.filter.each do |object|
153
+ it "filter should" do
154
+ @bucket.filter do |object|
157
155
  object.should be_instance_of(Hash)
158
156
  end
159
157
  end