From c28e9efde7e0c384b5f959e6eb48fa47d073227e Mon Sep 17 00:00:00 2001 From: Brock Trappitt Date: Tue, 27 May 2014 09:16:28 +0800 Subject: Test which checks the error being raised by #unsupported in ToSql Visitor --- test/visitors/test_to_sql.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index 05e75b5e0d..5d5a351737 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -247,6 +247,12 @@ module Arel compile(Nodes.build_quoted(nil)).must_be_like "NULL" end + it "unsupported input should not raise ArgumentError" do + assert_raises(RuntimeError) do + compile(nil) + end + end + it "should visit_Arel_SelectManager, which is a subquery" do mgr = Table.new(:foo).project(:bar) compile(mgr).must_be_like '(SELECT bar FROM "foo")' -- cgit v1.2.3