From bfb770dbcc8432b8d4c1824be0fb2b1ab1ce5d68 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Mon, 24 Jul 2017 09:08:24 -0400 Subject: Fix test failures --- test/collectors/test_sql_string.rb | 4 ++-- test/test_update_manager.rb | 2 +- test/visitors/test_dot.rb | 2 +- test/visitors/test_oracle.rb | 8 ++++---- test/visitors/test_oracle12.rb | 4 ++-- test/visitors/test_postgres.rb | 4 ++-- test/visitors/test_to_sql.rb | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/collectors/test_sql_string.rb b/test/collectors/test_sql_string.rb index debec8e9c9..0185f2ab17 100644 --- a/test/collectors/test_sql_string.rb +++ b/test/collectors/test_sql_string.rb @@ -27,7 +27,7 @@ module Arel end def test_compile - bv = Nodes::BindParam.new(nil) + bv = Nodes::BindParam.new(1) collector = collect ast_with_binds bv sql = collector.compile ["hello", "world"] @@ -35,7 +35,7 @@ module Arel end def test_returned_sql_uses_utf8_encoding - bv = Nodes::BindParam.new(nil) + bv = Nodes::BindParam.new(1) collector = collect ast_with_binds bv sql = collector.compile ["hello", "world"] diff --git a/test/test_update_manager.rb b/test/test_update_manager.rb index 187ded12f6..4a373d1ff7 100644 --- a/test/test_update_manager.rb +++ b/test/test_update_manager.rb @@ -13,7 +13,7 @@ module Arel table = Table.new(:users) um = Arel::UpdateManager.new um.table table - um.set [[table[:name], Arel::Nodes::BindParam.new(nil)]] + um.set [[table[:name], Arel::Nodes::BindParam.new(1)]] um.to_sql.must_be_like %{ UPDATE "users" SET "name" = ? } end 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="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 (?)' -- cgit v1.2.3