   (fact "Creating an object with an ACL returns the same ACL when you read
         the ACL"
         (with-random-cred c
-          (do
-            ;; create a bucket
-            (s3/create-bucket c bucket-name)
-            (s3/put-object c bucket-name object-name value-string {}
-                           (s3/grant :all-users :read))
-            (contains?
-             (:grants (s3/get-object-acl c bucket-name object-name))
-             public-read-grant)))
-        => truthy))
+          (s3/create-bucket c bucket-name)
+          (s3/put-object c bucket-name object-name value-string {}
+                         (s3/grant :all-users :read))
+          (:grants (s3/get-object-acl c bucket-name object-name)))
+        => (contains (just public-read-grant))))
 
 (let [bucket-name (random-string)
       object-name (random-string)

  (:require [clojure.tools.logging :as log])
  (:use midje.sweet))

(def ^:internal riak-cs-host-with-protocol "http://localhost")
(def ^:internal riak-cs-host "localhost")

(defn input-stream-from-string
  [s]
  (java.io.ByteArrayInputStream. (.getBytes s "UTF-8")))

(defn get-riak-cs-port-str
  "Try to get a TCP port number from the OS environment"

   :proxy {:host riak-cs-host
           :port (get-riak-cs-port)}})

(defn random-user
  []
  (user-creation/create-random-user riak-cs-host-with-protocol (get-riak-cs-port)))

(defmacro with-random-user
  "Execute `body` in implicit do with a random-user bound to `var-name`"
  [var-name & body]
  `(let [~var-name (random-user)]
     (do ~@body)))

(defn random-cred
  []
  (user-to-cred (random-user)))

(defmacro with-random-cred
  "Execute `body` in implicit do with a random-cred bound to `var-name`"
  [var-name & body]
  `(let [~var-name (random-cred)]
     (do ~@body)))

(defn random-string []
  (str (java.util.UUID/randomUUID)))

(defn write-file [filename content]
  (with-open [w (clojure.java.io/writer filename :append false)]
    (.write w content)))

(defn etag-suffix [etag]
