diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-18 08:30:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-18 08:30:24 +0000 |
commit | 3367daf716bda6e73f3418dd601bd1713d557c07 (patch) | |
tree | 2d78598b19862c92493aba8d3a4f375461dc5010 /spec | |
parent | 32fd8649d8ad091542a26293d948b3aebc385267 (diff) | |
download | ruby-3367daf716bda6e73f3418dd601bd1713d557c07.tar.gz |
Tests of Enumerator::Yielder#yield with multiple arguments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/core/enumerator/yielder/yield_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/core/enumerator/yielder/yield_spec.rb b/spec/ruby/core/enumerator/yielder/yield_spec.rb index 94cce7652d..58fc8e007a 100644 --- a/spec/ruby/core/enumerator/yielder/yield_spec.rb +++ b/spec/ruby/core/enumerator/yielder/yield_spec.rb @@ -9,6 +9,13 @@ describe "Enumerator::Yielder#yield" do ary.should == [1] end + it "yields with passed arguments" do + yields = [] + y = Enumerator::Yielder.new {|*args| yields << args } + y.yield 1, 2 + yields.should == [[1, 2]] + end + it "returns the result of the block for the given value" do y = Enumerator::Yielder.new {|x| x + 1} y.yield(1).should == 2 |