Sha256: 582b2eb1ac2e6f87f31d80e0cf2d0b1975731617678900630bb62294bf5f0659
Contents?: true
Size: 565 Bytes
Versions: 4
Compression:
Stored size: 565 Bytes
Contents
RSpec.describe "Array#map_strings" do it "should transforms all strings in infinite recursion" do array = ["hey", ["hi", {a: "ho", b: {d: "he"}}]] result = array.map_strings { |str| str.upcase } expect(result).to eq ["HEY", ["HI", {a: "HO", b: {d: "HE"}}]] end end RSpec.describe "Array#map_strings!" do it "should transforms all strings in infinite recursion" do array = ["hey", ["hi", {a: "ho", b: {d: "he"}}]] array.map_strings! { |str| str.upcase } expect(array).to eq ["HEY", ["HI", {a: "HO", b: {d: "HE"}}]] end end
Version data entries
4 entries across 4 versions & 1 rubygems