1
0
Fork 0
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:
geemus 2012-02-08 12:20:41 -06:00
commit ccab472748
2 changed files with 17 additions and 1 deletions

View file

@ -69,7 +69,7 @@ module Fog
end end
response = Excon::Response.new response = Excon::Response.new
if bucket = self.data[:buckets][bucket_name] 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) || (prefix && object['Key'][0...prefix.length] != prefix) ||
(marker && object['Key'] <= marker) || (marker && object['Key'] <= marker) ||
(delimiter && object['Key'][(prefix ? prefix.length : 0)..-1].include?(delimiter) \ (delimiter && object['Key'][(prefix ? prefix.length : 0)..-1].include?(delimiter) \

View file

@ -134,6 +134,22 @@ Shindo.tests('Fog::Storage[:aws] | versioning', [:aws]) do
end end
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 delete_bucket
end end