Sha256: 1086d5e485d050ae560599de10eb83760ea7d55e65e905347a148f61b01121c3
Contents?: true
Size: 549 Bytes
Versions: 8
Compression:
Stored size: 549 Bytes
Contents
# encoding: utf-8 class Nanoc3::ExtraCoreExtEnumerableTest < MiniTest::Unit::TestCase include Nanoc3::TestHelpers 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
8 entries across 8 versions & 1 rubygems