1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-09-30 12:21:48 +02:00
parent ce986b41ca
commit 201d501640
17 changed files with 209 additions and 6 deletions

View file

@ -238,6 +238,18 @@ describe "C-API Kernel function" do
end
end
describe "rb_yield_values2" do
it "yields passed arguments" do
ret = nil
@s.rb_yield_values2([1, 2]) { |x, y| ret = x + y }
ret.should == 3
end
it "returns the result from block evaluation" do
@s.rb_yield_values2([1, 2]) { |x, y| x + y }.should == 3
end
end
describe "rb_yield_splat" do
it "yields with passed array's contents" do
ret = nil