1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[rackspace|storage] removing type conversion for metadata per https://github.com/fog/fog/pull/1587

This commit is contained in:
Kyle Rames 2013-02-25 09:54:34 -06:00
parent bb081ded4a
commit 1aea726f28
4 changed files with 5 additions and 5 deletions

View file

@ -42,7 +42,7 @@ module Fog
headers.each_pair do |k, v|
key = Metadata.to_key(k)
next unless key
metadata.data[key] = Fog::JSON.decode(v)
metadata.data[key] = v
end
metadata
end

View file

@ -14,7 +14,7 @@ Shindo.tests('Fog::Rackspace::Storage | directories', ['rackspace']) do
tests('#get').succeeds do
instance = @service.directories.get @name
returns(false) { instance.nil? }
returns(true) { instance.metadata[:fog_test] }
returns('true') { instance.metadata[:fog_test] }
returns(@name) { instance.key }
returns(1) { instance.count }
returns( Fog::Storage.get_body_size(lorem_file)) {instance.bytes }

View file

@ -119,7 +119,7 @@ Shindo.tests('Fog::Rackspace::Storage | directory', ['rackspace']) do
@service.put_container(@instance.key, {"X-Container-Meta-List-Test"=>"true"} )
dir = @service.directories.find {|d| d.key == @instance.key }
returns(nil) { dir.instance_variable_get("@metadata") }
returns(true) { dir.metadata[:list_test] }
returns('true') { dir.metadata[:list_test] }
end
end

View file

@ -31,11 +31,11 @@ Shindo.tests('Fog::Rackspace::Storage | metadata', ['rackspace']) do
metadata.to_headers
end
tests("#from_headers").returns({:my_boolean=>true, :my_integer=>42, :my_string=>"I am a string"}) do
tests("#from_headers").returns({:my_boolean=>"true", :my_integer=>"42", :my_string=>"I am a string"}) do
headers = {
"X-Container-Meta-My-Integer"=> "42",
"X-Container-Meta-My-Boolean"=> "true",
"X-Container-Meta-My-String"=> "\"I am a string\""
"X-Container-Meta-My-String"=> "I am a string"
}
metadata = Fog::Storage::Rackspace::Metadata.from_headers headers