Sha256: 91817cf2cd9c465f4033417797ffe3dc9f4892e635db1d2420fcdca803b4fca6
Contents?: true
Size: 431 Bytes
Versions: 21
Compression:
Stored size: 431 Bytes
Contents
describe "Enumerable#each_with_object" do before :each do @values = [2, 5, 3, 6, 1, 4] @enum = EnumerableSpecs::Numerous.new(*@values) @initial = "memo" end it "passes each element and its argument to the block" do acc = [] @enum.each_with_object(@initial) do |elem, obj| obj.should equal(@initial) obj = 42 acc << elem end.should equal(@initial) acc.should == @values end end
Version data entries
21 entries across 21 versions & 1 rubygems