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
2020-10-24 15:53:53 +02:00

20 lines
742 B
Ruby

require_relative '../../spec_helper'
require_relative 'fixtures/classes'
require_relative '../../shared/enumerable/minmax'
describe "Enumerable#minmax" do
before :each do
@enum = EnumerableSpecs::Numerous.new(6, 4, 5, 10, 8)
@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
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