diff options
Diffstat (limited to 'spec/ruby/library/set/divide_spec.rb')
-rw-r--r-- | spec/ruby/library/set/divide_spec.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/ruby/library/set/divide_spec.rb b/spec/ruby/library/set/divide_spec.rb index 998a1b292c..314d9942eb 100644 --- a/spec/ruby/library/set/divide_spec.rb +++ b/spec/ruby/library/set/divide_spec.rb @@ -26,10 +26,20 @@ describe "Set#divide when passed a block with an arity of 2" do set.map{ |x| x.to_a.sort }.sort.should == [[1], [3, 4], [6], [9, 10, 11]] end - it "yields each two Object to the block" do - ret = [] - Set[1, 2].divide { |x, y| ret << [x, y] } - ret.sort.should == [[1, 1], [1, 2], [2, 1], [2, 2]] + ruby_version_is "3.5" do + it "yields each two Object to the block" do + ret = [] + Set[1, 2].divide { |x, y| ret << [x, y] } + ret.sort.should == [[1, 2], [2, 1]] + end + end + + ruby_version_is ""..."3.5" do + it "yields each two Object to the block" do + ret = [] + Set[1, 2].divide { |x, y| ret << [x, y] } + ret.sort.should == [[1, 1], [1, 2], [2, 1], [2, 2]] + end end it "returns an enumerator when not passed a block" do |