diff options
author | TSUYUSATO Kitsune <make.just.on@gmail.com> | 2021-10-25 12:13:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-25 12:13:44 +0900 |
commit | dfb47bbd17c3c2b8ce17dbafaf62df023b0224b2 (patch) | |
tree | f76585ae3d195837be9d929f96c396b6f627f0fd /spec | |
parent | aa09c8dae0ac2901264f2882467fac3083b52f32 (diff) |
Fix `Enumerable#each_cons` and `Enumerable#each_slice` to return a receiver
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/1509
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/core/enumerable/each_cons_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/enumerable/each_slice_spec.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/enumerable/each_cons_spec.rb b/spec/ruby/core/enumerable/each_cons_spec.rb index 7d44f54f74..ba658203a2 100644 --- a/spec/ruby/core/enumerable/each_cons_spec.rb +++ b/spec/ruby/core/enumerable/each_cons_spec.rb @@ -10,7 +10,7 @@ describe "Enumerable#each_cons" do it "passes element groups to the block" do acc = [] - @enum.each_cons(3){|g| acc << g}.should be_nil + @enum.each_cons(3){|g| acc << g} acc.should == @in_threes end @@ -27,7 +27,7 @@ describe "Enumerable#each_cons" do it "tries to convert n to an Integer using #to_int" do acc = [] - @enum.each_cons(3.3){|g| acc << g}.should == nil + @enum.each_cons(3.3){|g| acc << g} acc.should == @in_threes obj = mock('to_int') diff --git a/spec/ruby/core/enumerable/each_slice_spec.rb b/spec/ruby/core/enumerable/each_slice_spec.rb index ab3b79c344..2ea89f5e72 100644 --- a/spec/ruby/core/enumerable/each_slice_spec.rb +++ b/spec/ruby/core/enumerable/each_slice_spec.rb @@ -10,7 +10,7 @@ describe "Enumerable#each_slice" do it "passes element groups to the block" do acc = [] - @enum.each_slice(3){|g| acc << g}.should be_nil + @enum.each_slice(3){|g| acc << g} acc.should == @sliced end @@ -27,7 +27,7 @@ describe "Enumerable#each_slice" do it "tries to convert n to an Integer using #to_int" do acc = [] - @enum.each_slice(3.3){|g| acc << g}.should == nil + @enum.each_slice(3.3){|g| acc << g} acc.should == @sliced obj = mock('to_int') |