File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3333
3434 -> { range . minmax } . should raise_error ( RangeError , 'cannot get the maximum of endless range' )
3535 end
36+ end
3637
37- # Beginless ranges introduced in 2.7
38+ ruby_version_is '2.7' ...'3.0' do
39+ it 'raises ArgumentError on a beginless range' do
40+ # Beginless range literal would cause SyntaxError prior to 2.7
41+ range = Range . new ( nil , @x )
42+
43+ -> { range . minmax } . should raise_error ( ArgumentError )
44+ end
45+ end
46+
47+ ruby_version_is '3.0' do
3848 it 'should raise RangeError on a beginless range' do
3949 # Beginless range literal would cause SyntaxError prior to 2.7
4050 range = Range . new ( nil , @x )
120130 # Beginless range literal would cause SyntaxError prior to 2.7
121131 range = Range . new ( nil , @x , true )
122132
123- -> { range . minmax } . should raise_error ( RangeError , 'cannot get the minimum of beginless range' )
133+ -> { range . minmax } . should raise_error ( RangeError ,
134+ /cannot get the maximum of beginless range with custom comparison method|cannot get the minimum of beginless range/ )
124135 end
125136 end
126137
You can’t perform that action at this time.
0 commit comments