Sha256: 5d8bc6f58a16747faf08e46db5f96cf4c1aefb0c178ec0a369064cfd8799eab4
Contents?: true
Size: 508 Bytes
Versions: 14
Compression:
Stored size: 508 Bytes
Contents
# encoding: utf-8 class Nanoc::ExtraCoreExtEnumerableTest < Nanoc::TestCase class MyCollection include Enumerable def initialize(array) @array = array end def each(&block) @array.each { |i| block.call(i) } end end def test_group_by input = MyCollection.new([ 'foo', 'bar', 'baz' ]) output_expected = { ?f => [ 'foo' ], ?b => [ 'bar', 'baz' ] } output_actual = input.group_by { |i| i[0] } assert_equal output_expected, output_actual end end
Version data entries
14 entries across 14 versions & 1 rubygems