lib/fog/rackspace/requests/storage/put_container.rb in fog-maestrodev-1.19.0.20140212012611 vs lib/fog/rackspace/requests/storage/put_container.rb in fog-maestrodev-1.20.0.20140305101305

- old
+ new

@@ -1,8 +1,9 @@ module Fog module Storage class Rackspace + class Real # Create a new container # # ==== Parameters @@ -19,8 +20,23 @@ :path => Fog::Rackspace.escape(name) ) end end + + class Mock + def put_container(name, options={}) + existed = ! mock_container(name).nil? + container = add_container(name) + options.keys.each do |k| + container.meta[k] = options[k].to_s if k =~ /^X-Container-Meta/ + end + + response = Excon::Response.new + response.status = existed ? 202 : 201 + response + end + end + end end end