diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/visitors/test_depth_first.rb | 8 | ||||
-rw-r--r-- | test/visitors/test_to_sql.rb | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/visitors/test_depth_first.rb b/test/visitors/test_depth_first.rb index baa8f64184..d50ea3e59a 100644 --- a/test/visitors/test_depth_first.rb +++ b/test/visitors/test_depth_first.rb @@ -1,4 +1,5 @@ require 'helper' +require 'set' module Arel module Visitors @@ -171,6 +172,13 @@ module Arel assert_equal [:a, :b, node, list], @collector.calls end + def test_set + node = Nodes::Or.new(:a, :b) + set = Set.new([node]) + @visitor.accept set + assert_equal [:a, :b, node, set], @collector.calls + end + def test_hash node = Nodes::Or.new(:a, :b) hash = { node => node } diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index c03d89cfef..d84142e27a 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -1,4 +1,5 @@ require 'helper' +require 'set' module Arel module Visitors @@ -228,6 +229,10 @@ module Arel compile(Nodes.build_quoted({:a => 1})) end + it "should visit_Set" do + @visitor.accept Set.new([1, 2]) + end + it "should visit_BigDecimal" do compile Nodes.build_quoted(BigDecimal.new('2.14')) end |