mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
parent
cbe3156f82
commit
f118e0ce73
Notes:
git
2025-03-07 11:44:24 +00:00
1 changed files with 17 additions and 3 deletions
|
@ -55,11 +55,25 @@ describe "Range#max" do
|
|||
(..1.0).max.should == 1.0
|
||||
end
|
||||
|
||||
it "raises for an exclusive beginless range" do
|
||||
ruby_version_is ""..."3.5" do
|
||||
it "raises for an exclusive beginless Integer range" do
|
||||
-> {
|
||||
(...1).max
|
||||
}.should raise_error(TypeError, 'cannot exclude end value with non Integer begin value')
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is "3.5" do
|
||||
it "returns the end point for exclusive beginless Integer ranges" do
|
||||
(...1).max.should == 0
|
||||
end
|
||||
end
|
||||
|
||||
it "raises for an exclusive beginless non Integer range" do
|
||||
-> {
|
||||
(...1.0).max
|
||||
}.should raise_error(TypeError, 'cannot exclude non Integer end value')
|
||||
end
|
||||
end
|
||||
|
||||
describe "Range#max given a block" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue