Sha256: e752e19331d6f022965d32cc8e725e66c5f2a6da8d56b5eafbfa3968919eb56e
Contents?: true
Size: 547 Bytes
Versions: 17
Compression:
Stored size: 547 Bytes
Contents
# encoding: utf-8 class Nanoc::ExtraCoreExtEnumerableTest < MiniTest::Unit::TestCase include Nanoc::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
17 entries across 17 versions & 1 rubygems