1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/enumerable/minmax_spec.rb

21 lines
742 B
Ruby
Raw Normal View History

require_relative '../../spec_helper'
require_relative 'fixtures/classes'
2020-10-24 09:52:37 -04:00
require_relative '../../shared/enumerable/minmax'
describe "Enumerable#minmax" do
before :each do
@enum = EnumerableSpecs::Numerous.new(6, 4, 5, 10, 8)
2020-10-24 09:52:37 -04:00
@empty_enum = EnumerableSpecs::Empty.new
@incomparable_enum = EnumerableSpecs::Numerous.new(BasicObject.new, BasicObject.new)
@incompatible_enum = EnumerableSpecs::Numerous.new(11,"22")
@strs = EnumerableSpecs::Numerous.new("333", "2", "60", "55555", "1010", "111")
end
2020-10-24 09:52:37 -04:00
it_behaves_like :enumerable_minmax, :minmax
it "gathers whole arrays as elements when each yields multiple" do
multi = EnumerableSpecs::YieldsMulti.new
multi.minmax.should == [[1, 2], [6, 7, 8, 9]]
end
end