aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_to_sql.rb
diff options
context:
space:
mode:
authorBrock Trappitt <brock.trappitt@gmail.com>2014-05-27 09:16:28 +0800
committerBrock Trappitt <brock.trappitt@gmail.com>2014-05-27 09:16:28 +0800
commitc28e9efde7e0c384b5f959e6eb48fa47d073227e (patch)
tree031eefa397c02393f6855899c2c9e43944ee49e1 /test/visitors/test_to_sql.rb
parente7f0cbbeea28718c8ff2b588cba20ccc298347bf (diff)
downloadrails-c28e9efde7e0c384b5f959e6eb48fa47d073227e.tar.gz
rails-c28e9efde7e0c384b5f959e6eb48fa47d073227e.tar.bz2
rails-c28e9efde7e0c384b5f959e6eb48fa47d073227e.zip
Test which checks the error being raised by #unsupported in ToSql Visitor
Diffstat (limited to 'test/visitors/test_to_sql.rb')
-rw-r--r--test/visitors/test_to_sql.rb6
1 files changed, 6 insertions, 0 deletions
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")'