<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 trunk:
 
+- Bug #19158 fixed. Don't prepend leading slash onto bucket name when deleting a bucket with the :force =&gt; true option.
+
 - Bug #17628 fixed. Don't ignore :use_ssl =&gt; false in url_for when the connection is established over ssl. Reported by [Tom Fixed (tkat11)]
 
 - Bug #13052 fixed. Appease some proxies by always including a Content-Length with all requests. Reported by [James Murty (jmurty)]</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -157,11 +157,10 @@ module AWS
         #
         # Only the owner of a bucket can delete a bucket, regardless of the bucket's access control policy.
         def delete(name = nil, options = {})
-          name = path(name)
           find(name).delete_all if options[:force]
-          # A bit confusing. Calling super actually makes makes an HTTP DELETE request. The delete method is
-          # defined in the Base class. It happens to have the same name.
-          super(name).success?
+          
+          name = path(name)
+          Base.delete(name).success?
         end
         
         # List all your buckets. This is a convenient wrapper around AWS::S3::Service.buckets.</diff>
      <filename>lib/aws/s3/bucket.rb</filename>
    </modified>
    <modified>
      <diff>@@ -54,4 +54,21 @@ class BucketTest &lt; Test::Unit::TestCase
     bucket = Bucket.find('marcel_molina')
     assert bucket.is_truncated    
   end
+  
+  def test_bucket_name_should_have_leading_slash_prepended_only_once_when_forcing_a_delete
+    # References bug: http://rubyforge.org/tracker/index.php?func=detail&amp;aid=19158&amp;group_id=2409&amp;atid=9356
+    bucket_name          = 'foo'
+    expected_bucket_path = &quot;/#{bucket_name}&quot;
+    
+    mock_bucket = flexmock('Mock bucket') do |mock|
+      mock.should_receive(:delete_all).once
+    end
+    mock_response = flexmock('Mock delete response') do |mock|
+      mock.should_receive(:success?).once
+    end
+    
+    flexmock(Bucket).should_receive(:find).with(bucket_name).once.and_return(mock_bucket)
+    flexmock(Base).should_receive(:delete).with(expected_bucket_path).once.and_return(mock_response)
+    Bucket.delete(bucket_name, :force =&gt; true)
+  end
 end
\ No newline at end of file</diff>
      <filename>test/bucket_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9322ad0b415d7deeb3f79edde1daee4e5f92214d</id>
    </parent>
  </parents>
  <author>
    <name>Marcel Molina</name>
    <email>marcel@marcelmolina.com</email>
  </author>
  <url>http://github.com/marcel/aws-s3/commit/68cd7562a2fcec7a89e83fea4448b3b82d5688d1</url>
  <id>68cd7562a2fcec7a89e83fea4448b3b82d5688d1</id>
  <committed-date>2008-06-06T22:06:34-07:00</committed-date>
  <authored-date>2008-06-06T22:06:34-07:00</authored-date>
  <message>Don't prepend leading slash onto bucket name when deleting a bucket with the :force =&gt; true option.</message>
  <tree>2193d576336b08e825c2bbc116fc0c5ba7706121</tree>
  <committer>
    <name>Marcel Molina</name>
    <email>marcel@marcelmolina.com</email>
  </committer>
</commit>
