Skip to content

Commit 927b3b5

Browse files
authored
Merge pull request rails#47345 from Cofense/arel-predicate-exclusive-infinite-range-greater-than
Add test case for Arel condition exclusive open-ended range
2 parents 2f23576 + 646538e commit 927b3b5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

activerecord/test/cases/arel/attributes/attribute_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,16 @@ class AttributeTest < Arel::Spec
658658
)
659659
end
660660

661+
it "can be constructed with an exclusive range implicitly ending at Infinity" do
662+
attribute = Attribute.new nil, nil
663+
node = attribute.between(0...)
664+
665+
_(node).must_equal Nodes::GreaterThanOrEqual.new(
666+
attribute,
667+
Nodes::Casted.new(0, attribute)
668+
)
669+
end
670+
661671
it "can be constructed with a quoted range ending at Infinity" do
662672
attribute = Attribute.new nil, nil
663673
node = attribute.between(quoted_range(0, ::Float::INFINITY, false))

0 commit comments

Comments
 (0)