parent
907aa47527
commit
e83c02a768
Notes:
git
2021-11-06 00:22:41 +09:00
2
enum.c
2
enum.c
@ -713,7 +713,7 @@ enum_to_a(int argc, VALUE *argv, VALUE obj)
|
|||||||
{
|
{
|
||||||
VALUE ary = rb_ary_new();
|
VALUE ary = rb_ary_new();
|
||||||
|
|
||||||
rb_block_call(obj, id_each, argc, argv, collect_all, ary);
|
rb_block_call_kw(obj, id_each, argc, argv, collect_all, ary, RB_PASS_CALLED_KEYWORDS);
|
||||||
|
|
||||||
return ary;
|
return ary;
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,11 @@ class TestEnumerable < Test::Unit::TestCase
|
|||||||
assert_equal([1, 2, 3, 1, 2], @obj.to_a)
|
assert_equal([1, 2, 3, 1, 2], @obj.to_a)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_to_a_keywords
|
||||||
|
def @obj.each(foo:) yield foo end
|
||||||
|
assert_equal([1], @obj.to_a(foo: 1))
|
||||||
|
end
|
||||||
|
|
||||||
def test_to_a_size_symbol
|
def test_to_a_size_symbol
|
||||||
sym = Object.new
|
sym = Object.new
|
||||||
class << sym
|
class << sym
|
||||||
|
Loading…
x
Reference in New Issue
Block a user