aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_depth_first.rb
diff options
context:
space:
mode:
authorDimko <deemox@gmail.com>2012-09-18 12:27:33 +0400
committerDimko <deemox@gmail.com>2012-09-18 12:27:33 +0400
commit112617766915b0068027b4ac809dad8129c88e81 (patch)
tree5bcd2b69e3f2c449bb608b79e7b4a7c45609eb8c /test/visitors/test_depth_first.rb
parente032dabdb2adb34e3db8cd35e9f58bc0536475c1 (diff)
downloadrails-112617766915b0068027b4ac809dad8129c88e81.tar.gz
rails-112617766915b0068027b4ac809dad8129c88e81.tar.bz2
rails-112617766915b0068027b4ac809dad8129c88e81.zip
added a visitor for Set objects
Diffstat (limited to 'test/visitors/test_depth_first.rb')
-rw-r--r--test/visitors/test_depth_first.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/visitors/test_depth_first.rb b/test/visitors/test_depth_first.rb
index 05360ff6e8..38d12b487c 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
@@ -159,6 +160,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 }