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/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 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'test/visitors') 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