mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge branch 'master' of github.com:fog/fog
This commit is contained in:
commit
ccab472748
2 changed files with 17 additions and 1 deletions
|
@ -69,7 +69,7 @@ module Fog
|
|||
end
|
||||
response = Excon::Response.new
|
||||
if bucket = self.data[:buckets][bucket_name]
|
||||
contents = bucket[:objects].values.collect(&:last).sort {|x,y| x['Key'] <=> y['Key']}.reject do |object|
|
||||
contents = bucket[:objects].values.collect(&:first).sort {|x,y| x['Key'] <=> y['Key']}.reject do |object|
|
||||
(prefix && object['Key'][0...prefix.length] != prefix) ||
|
||||
(marker && object['Key'] <= marker) ||
|
||||
(delimiter && object['Key'][(prefix ? prefix.length : 0)..-1].include?(delimiter) \
|
||||
|
|
|
@ -134,6 +134,22 @@ Shindo.tests('Fog::Storage[:aws] | versioning', [:aws]) do
|
|||
end
|
||||
end
|
||||
|
||||
tests("get_bucket('#{@aws_bucket_name}'") do
|
||||
clear_bucket
|
||||
|
||||
file = Fog::Storage[:aws].directories.get(@aws_bucket_name).files.create(:body => 'a', :key => 'file')
|
||||
|
||||
tests("includes a non-DeleteMarker object").returns(1) do
|
||||
Fog::Storage[:aws].get_bucket(@aws_bucket_name).body['Contents'].size
|
||||
end
|
||||
|
||||
file.destroy
|
||||
|
||||
tests("does not include a DeleteMarker object").returns(0) do
|
||||
Fog::Storage[:aws].get_bucket(@aws_bucket_name).body['Contents'].size
|
||||
end
|
||||
end
|
||||
|
||||
delete_bucket
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue