ruby-changes:54890
From: marcandre <ko1@a...>
Date: Wed, 20 Feb 2019 13:40:01 +0900 (JST)
Subject: [ruby-changes:54890] marcandRe: r67095 (trunk): * spec/ruby: Tweak Enuemrator::Chain#rewind spec so that arity of block matches what is yielded
marcandre 2019-02-20 13:39:56 +0900 (Wed, 20 Feb 2019) New Revision: 67095 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67095 Log: * spec/ruby: Tweak Enuemrator::Chain#rewind spec so that arity of block matches what is yielded Calling `and_yield(*args)` adds an implicit expectation that all the `args` are passed to a block that can accept them, even though blocks that are not lambda-like don't mind extra arguments. It so happens that this spec passed on Ruby 2.6.1 See [Bug #15613] Modified files: trunk/spec/ruby/core/enumerator/chain/rewind_spec.rb Index: spec/ruby/core/enumerator/chain/rewind_spec.rb =================================================================== --- spec/ruby/core/enumerator/chain/rewind_spec.rb (revision 67094) +++ spec/ruby/core/enumerator/chain/rewind_spec.rb (revision 67095) @@ -4,9 +4,9 @@ ruby_version_is "2.6" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/enumerator/chain/rewind_spec.rb#L4 describe "Enumerator::Chain#rewind" do before(:each) do @obj = mock('obj') - @obj.should_receive(:each).any_number_of_times.and_yield(42) + @obj.should_receive(:each).any_number_of_times.and_yield @second = mock('obj') - @second.should_receive(:each).any_number_of_times.and_yield(:second) + @second.should_receive(:each).any_number_of_times.and_yield @enum = Enumerator::Chain.new(@obj, @second) end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/