diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-06 09:36:13 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-06 09:36:13 -0800 |
commit | e4ea62bdec406f0bc8692b6cfad83c17ac6773d6 (patch) | |
tree | 40887946c29875f0ad282d804e8b1f73bd85c635 /test | |
parent | ac6296ab8f9d38dbfa8149eb0c6e16d6957dd519 (diff) | |
parent | 516ae526b34333073df7a9835952d5d499197fdd (diff) | |
download | rails-e4ea62bdec406f0bc8692b6cfad83c17ac6773d6.tar.gz rails-e4ea62bdec406f0bc8692b6cfad83c17ac6773d6.tar.bz2 rails-e4ea62bdec406f0bc8692b6cfad83c17ac6773d6.zip |
Merge branch '2-0-stable'
* 2-0-stable:
adding a test for the dot visitor
Diffstat (limited to 'test')
-rw-r--r-- | test/visitors/test_dot.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/visitors/test_dot.rb b/test/visitors/test_dot.rb new file mode 100644 index 0000000000..19a554ce42 --- /dev/null +++ b/test/visitors/test_dot.rb @@ -0,0 +1,27 @@ +require 'helper' + +module Arel + module Visitors + class TestDot < MiniTest::Unit::TestCase + def setup + @visitor = Visitors::Dot.new + end + + # unary ops + [ + Arel::Nodes::Not, + Arel::Nodes::Group, + Arel::Nodes::On, + Arel::Nodes::Grouping, + Arel::Nodes::Offset, + Arel::Nodes::Having, + Arel::Nodes::UnqualifiedColumn, + ].each do |klass| + define_method("test_#{klass.name.gsub('::', '_')}") do + op = klass.new(:a) + @visitor.accept op + end + end + end + end +end |