aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-09 14:31:10 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-09 14:31:10 -0700
commitf81965509d74a4607ecbc3cc6f91c2ca22919f3a (patch)
tree1cf0858990af7791e3c21e6a267af7d8e0eab0b3 /test
parent9c87737c9abefdf059a06f1213e8dee2d87f308a (diff)
downloadrails-f81965509d74a4607ecbc3cc6f91c2ca22919f3a.tar.gz
rails-f81965509d74a4607ecbc3cc6f91c2ca22919f3a.tar.bz2
rails-f81965509d74a4607ecbc3cc6f91c2ca22919f3a.zip
add a compile method to the collectors
Diffstat (limited to 'test')
-rw-r--r--test/collectors/test_bind_collector.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/collectors/test_bind_collector.rb b/test/collectors/test_bind_collector.rb
index c7748d7d10..036d8f05fe 100644
--- a/test/collectors/test_bind_collector.rb
+++ b/test/collectors/test_bind_collector.rb
@@ -57,6 +57,14 @@ module Arel
assert_equal 'SELECT FROM "users" WHERE "users"."age" = hello AND "users"."name" = world', list.join
end
+
+ def test_compile
+ bv = Nodes::BindParam.new('?')
+ collector = collect ast_with_binds bv
+
+ sql = collector.compile ["hello", "world"]
+ assert_equal 'SELECT FROM "users" WHERE "users"."age" = hello AND "users"."name" = world', sql
+ end
end
end
end