Sha256: ad4f352efdd8e725d36e47c9a2aacfcbc259066b2b5fea7c959e9ff0a1365a0f
Contents?: true
Size: 663 Bytes
Versions: 24
Compression:
Stored size: 663 Bytes
Contents
RSpec.describe "EitilCore Hash#transform_string_values" do it "should transforms all strings in infinite recursion" do hash = {a: "hey", b: {c: "hi", d: ["ho"]}} expected = {a: "HEY", b: {c: "HI", d: ["HO"]}} result = hash.transform_string_values { |str| str.upcase } expect(result).to eq expected end end RSpec.describe "EitilCore Hash#transform_string_values!" do it "should transforms all strings in infinite recursion" do hash = {a: "hey", b: {c: "hi", d: ["ho"]}} expected = {a: "HEY", b: {c: "HI", d: ["HO"]}} hash.transform_string_values! { |str| str.upcase } expect(hash).to eq expected end end
Version data entries
24 entries across 24 versions & 1 rubygems