aboutsummaryrefslogtreecommitdiffstats
path: root/test/nodes
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-03-24 16:26:09 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-03-24 16:26:09 -0700
commit93d72131bcc24ccb5536bec672d2dac94f8de651 (patch)
treeb0bddcce28817906b483c8f73c574d350ac844c4 /test/nodes
parent24995298face1d08ffb52f6c1b0374feeb7a380b (diff)
downloadrails-93d72131bcc24ccb5536bec672d2dac94f8de651.tar.gz
rails-93d72131bcc24ccb5536bec672d2dac94f8de651.tar.bz2
rails-93d72131bcc24ccb5536bec672d2dac94f8de651.zip
add the casting node to the AST at build time
If we add the casting node to the ast at build time, then we can avoid doing the lookup at visit time.
Diffstat (limited to 'test/nodes')
-rw-r--r--test/nodes/test_equality.rb2
-rw-r--r--test/nodes/test_grouping.rb2
-rw-r--r--test/nodes/test_sql_literal.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/test/nodes/test_equality.rb b/test/nodes/test_equality.rb
index 79764cc7d3..42a156b051 100644
--- a/test/nodes/test_equality.rb
+++ b/test/nodes/test_equality.rb
@@ -43,7 +43,7 @@ module Arel
attr = Table.new(:users)[:id]
test = attr.eq(10)
test.to_sql engine
- engine.connection.quote_count.must_equal 2
+ engine.connection.quote_count.must_equal 3
end
end
end
diff --git a/test/nodes/test_grouping.rb b/test/nodes/test_grouping.rb
index b7aa51d37f..febf0bee40 100644
--- a/test/nodes/test_grouping.rb
+++ b/test/nodes/test_grouping.rb
@@ -4,7 +4,7 @@ module Arel
module Nodes
describe 'Grouping' do
it 'should create Equality nodes' do
- grouping = Grouping.new('foo')
+ grouping = Grouping.new(Nodes.build_quoted('foo'))
grouping.eq('foo').to_sql.must_be_like %q{('foo') = 'foo'}
end
diff --git a/test/nodes/test_sql_literal.rb b/test/nodes/test_sql_literal.rb
index 085c5dad6b..2f17cfd72a 100644
--- a/test/nodes/test_sql_literal.rb
+++ b/test/nodes/test_sql_literal.rb
@@ -5,7 +5,7 @@ module Arel
module Nodes
describe 'sql literal' do
before do
- @visitor = Visitors::ToSql.new Table.engine.connection_pool
+ @visitor = Visitors::ToSql.new Table.engine.connection
end
describe 'sql' do