From f81965509d74a4607ecbc3cc6f91c2ca22919f3a Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 9 Apr 2014 14:31:10 -0700 Subject: add a compile method to the collectors --- test/collectors/test_bind_collector.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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 -- cgit v1.2.3