Sha256: 0d5140319bf2bc8bb2f88fdcd984f2275780db2f397e9c9ddd867472f098f714
Contents?: true
Size: 996 Bytes
Versions: 38
Compression:
Stored size: 996 Bytes
Contents
require "spec_helper" describe "Fog::StringifyKeys" do describe ".stringify" do describe "when key is a Symbol" do it "replaces key with String" do input = { :key => "value" } output = Fog::StringifyKeys.stringify(input) assert(output.key?("key")) end end describe "when key is a String" do it "keeps key as String" do input = { "key" => "value" } output = Fog::StringifyKeys.stringify(input) assert(output.key?("key")) end end describe "when Hash is empty" do it "returns empty Hash" do assert_equal({}, Fog::StringifyKeys.stringify({})) end end describe "when keys are deeply nested" do it "updates only top level key" do input = { :key1 => { :key2 => { :key3 => nil }}} output = Fog::StringifyKeys.stringify(input) expected = { "key1" => { :key2 => { :key3 => nil }}} assert_equal(expected, output) end end end end
Version data entries
38 entries across 35 versions & 3 rubygems