2 # returns the maximum value in the range when called with no arguments
3 assert_equal 'l', ('f'..'l').max
4 assert_equal 'e', ('a'...'f').max
6 # returns nil when the endpoint is less than the start point
7 assert_equal nil, ('z'..'l').max
10 assert('Range#max given a block') do
11 # returns nil when the endpoint is less than the start point
12 assert_equal nil, (('z'..'l').max { |x, y| x <=> y })
15 assert('Range#min') do
16 # returns the minimum value in the range when called with no arguments
17 assert_equal 'f', ('f'..'l').min
19 # returns nil when the start point is greater than the endpoint
20 assert_equal nil, ('z'..'l').min
23 assert('Range#min given a block') do
24 # returns nil when the start point is greater than the endpoint
25 assert_equal nil, (('z'..'l').min { |x, y| x <=> y })