Skip to content

Commit

Permalink
add spec for Range objects to be frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
lxxxvi authored and eregon committed Oct 11, 2021
1 parent 3379bbb commit 812bc59
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions language/range_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
(1...).should == Range.new(1, nil, true)
end

ruby_version_is "3.0" do
it "is frozen" do
(42..).should.frozen?
end
end

ruby_version_is "2.7" do
it "creates beginless ranges" do
eval("(..1)").should == Range.new(nil, 1)
Expand Down

0 comments on commit 812bc59

Please sign in to comment.