diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-09 14:31:10 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-09 14:31:10 -0700 |
commit | f81965509d74a4607ecbc3cc6f91c2ca22919f3a (patch) | |
tree | 1cf0858990af7791e3c21e6a267af7d8e0eab0b3 /test/collectors | |
parent | 9c87737c9abefdf059a06f1213e8dee2d87f308a (diff) | |
download | rails-f81965509d74a4607ecbc3cc6f91c2ca22919f3a.tar.gz rails-f81965509d74a4607ecbc3cc6f91c2ca22919f3a.tar.bz2 rails-f81965509d74a4607ecbc3cc6f91c2ca22919f3a.zip |
add a compile method to the collectors
Diffstat (limited to 'test/collectors')
-rw-r--r-- | test/collectors/test_bind_collector.rb | 8 |
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 |