diff --git a/aws-sdk-resources/features/s3/multipart_copy.feature b/aws-sdk-resources/features/s3/multipart_copy.feature index 98020bb54f1..86aa724615a 100644 --- a/aws-sdk-resources/features/s3/multipart_copy.feature +++ b/aws-sdk-resources/features/s3/multipart_copy.feature @@ -10,3 +10,9 @@ Feature: Managed multipart copies Given a "source_bucket" is set in cfg["s3"]["large_object"]["bucket"] And a "source_key" is set in cfg["s3"]["large_object"]["key"] Then I should be able to multipart copy the object to a different bucket + + Scenario: Copy object with space character + Given I create a bucket + And I have a 1MB file + And I upload the file to the "test object" object + Then I should be able to copy the object diff --git a/aws-sdk-resources/features/s3/step_definitions.rb b/aws-sdk-resources/features/s3/step_definitions.rb index 89c86f23acd..f334cfc4a2c 100644 --- a/aws-sdk-resources/features/s3/step_definitions.rb +++ b/aws-sdk-resources/features/s3/step_definitions.rb @@ -8,16 +8,7 @@ After("@s3") do @created_buckets.each do |bucket| - # TODO : provide a Bucket#delete! method - loop do - objects = bucket.client.list_object_versions(bucket: bucket.name) - objects = objects.data.versions.map do |v| - { key: v.key, version_id: v.version_id } - end - break if objects.empty? - bucket.client.delete_objects(bucket: bucket.name, delete: { objects: objects }) - end - bucket.delete + bucket.delete! end end @@ -130,3 +121,10 @@ target_object.copy_from("#{@source_bucket}/#{@source_key}", multipart_copy: true) expect(ApiCallTracker.called_operations).to include(:create_multipart_upload) end + +Then(/^I should be able to copy the object$/) do + target_bucket = @s3.bucket(@bucket_name) + target_object = target_bucket.object("test object-copy") + target_object.copy_from("#{@bucket_name}/test object") + expect(ApiCallTracker.called_operations).to include(:copy_object) +end