aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2017-07-24 09:08:24 -0400
committerSean Griffin <sean@seantheprogrammer.com>2017-07-24 09:08:24 -0400
commitbfb770dbcc8432b8d4c1824be0fb2b1ab1ce5d68 (patch)
treecf3ddae40bb0fb95ab41549003ae12778df972ed /test/visitors
parent7a29220c689feb0581e21d5324b85fc2f201ac5e (diff)
downloadrails-bfb770dbcc8432b8d4c1824be0fb2b1ab1ce5d68.tar.gz
rails-bfb770dbcc8432b8d4c1824be0fb2b1ab1ce5d68.tar.bz2
rails-bfb770dbcc8432b8d4c1824be0fb2b1ab1ce5d68.zip
Fix test failures
Diffstat (limited to 'test/visitors')
-rw-r--r--test/visitors/test_dot.rb2
-rw-r--r--test/visitors/test_oracle.rb8
-rw-r--r--test/visitors/test_oracle12.rb4
-rw-r--r--test/visitors/test_postgres.rb4
-rw-r--r--test/visitors/test_to_sql.rb4
5 files changed, 11 insertions, 11 deletions
diff --git a/test/visitors/test_dot.rb b/test/visitors/test_dot.rb
index 8067ff5b49..3c4a038116 100644
--- a/test/visitors/test_dot.rb
+++ b/test/visitors/test_dot.rb
@@ -74,7 +74,7 @@ module Arel
end
def test_Arel_Nodes_BindParam
- node = Arel::Nodes::BindParam.new(nil)
+ node = Arel::Nodes::BindParam.new(1)
collector = Collectors::PlainString.new
assert_match '[label="<f0>Arel::Nodes::BindParam"]', @visitor.accept(node, collector).value
end
diff --git a/test/visitors/test_oracle.rb b/test/visitors/test_oracle.rb
index cdadec8b15..603d0f1184 100644
--- a/test/visitors/test_oracle.rb
+++ b/test/visitors/test_oracle.rb
@@ -127,8 +127,8 @@ module Arel
it 'creates a subquery when there is limit and offset with BindParams' do
stmt = Nodes::SelectStatement.new
- stmt.limit = Nodes::Limit.new(Nodes::BindParam.new(nil))
- stmt.offset = Nodes::Offset.new(Nodes::BindParam.new(nil))
+ stmt.limit = Nodes::Limit.new(Nodes::BindParam.new(1))
+ stmt.offset = Nodes::Offset.new(Nodes::BindParam.new(1))
sql = compile stmt
sql.must_be_like %{
SELECT * FROM (
@@ -184,8 +184,8 @@ module Arel
describe "Nodes::BindParam" do
it "increments each bind param" do
- query = @table[:name].eq(Arel::Nodes::BindParam.new(nil))
- .and(@table[:id].eq(Arel::Nodes::BindParam.new(nil)))
+ query = @table[:name].eq(Arel::Nodes::BindParam.new(1))
+ .and(@table[:id].eq(Arel::Nodes::BindParam.new(1)))
compile(query).must_be_like %{
"users"."name" = :a1 AND "users"."id" = :a2
}
diff --git a/test/visitors/test_oracle12.rb b/test/visitors/test_oracle12.rb
index a6bbfe3077..62658bc595 100644
--- a/test/visitors/test_oracle12.rb
+++ b/test/visitors/test_oracle12.rb
@@ -48,8 +48,8 @@ module Arel
describe "Nodes::BindParam" do
it "increments each bind param" do
- query = @table[:name].eq(Arel::Nodes::BindParam.new(nil))
- .and(@table[:id].eq(Arel::Nodes::BindParam.new(nil)))
+ query = @table[:name].eq(Arel::Nodes::BindParam.new(1))
+ .and(@table[:id].eq(Arel::Nodes::BindParam.new(1)))
compile(query).must_be_like %{
"users"."name" = :a1 AND "users"."id" = :a2
}
diff --git a/test/visitors/test_postgres.rb b/test/visitors/test_postgres.rb
index 3b4fdc0427..beae117ef5 100644
--- a/test/visitors/test_postgres.rb
+++ b/test/visitors/test_postgres.rb
@@ -176,8 +176,8 @@ module Arel
describe "Nodes::BindParam" do
it "increments each bind param" do
- query = @table[:name].eq(Arel::Nodes::BindParam.new(nil))
- .and(@table[:id].eq(Arel::Nodes::BindParam.new(nil)))
+ query = @table[:name].eq(Arel::Nodes::BindParam.new(1))
+ .and(@table[:id].eq(Arel::Nodes::BindParam.new(1)))
compile(query).must_be_like %{
"users"."name" = $1 AND "users"."id" = $2
}
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb
index 445d9c476c..e95c0666b4 100644
--- a/test/visitors/test_to_sql.rb
+++ b/test/visitors/test_to_sql.rb
@@ -17,13 +17,13 @@ module Arel
end
it 'works with BindParams' do
- node = Nodes::BindParam.new(nil)
+ node = Nodes::BindParam.new(1)
sql = compile node
sql.must_be_like '?'
end
it 'does not quote BindParams used as part of a Values' do
- bp = Nodes::BindParam.new(nil)
+ bp = Nodes::BindParam.new(1)
values = Nodes::Values.new([bp])
sql = compile values
sql.must_be_like 'VALUES (?)'