提交 ac6e6545 编写于 作者: S Sean Griffin

Stop passing a column to `quote` in tests

I'm planning on deprecating the column argument to mirror the
deprecation in [arel].

[arel]: https://github.com/rails/arel/commit/6160bfbda1d1781c3b08a33ec4955f170e95be11
上级 268ee64e
...@@ -34,13 +34,14 @@ def test_quote_time_usec ...@@ -34,13 +34,14 @@ def test_quote_time_usec
def test_quote_range def test_quote_range
range = "1,2]'; SELECT * FROM users; --".."a" range = "1,2]'; SELECT * FROM users; --".."a"
c = PostgreSQLColumn.new(nil, nil, OID::Range.new(Type::Integer.new, :int8range)) type = OID::Range.new(Type::Integer.new, :int8range)
assert_equal "'[1,0]'", @conn.quote(range, c) assert_equal "'[1,0]'", @conn.quote(type.type_cast_for_database(range))
end end
def test_quote_bit_string def test_quote_bit_string
c = PostgreSQLColumn.new(nil, 1, OID::Bit.new) value = "'); SELECT * FROM users; /*\n01\n*/--"
assert_equal nil, @conn.quote("'); SELECT * FROM users; /*\n01\n*/--", c) type = OID::Bit.new
assert_equal nil, @conn.quote(type.type_cast_for_database(value))
end end
end end
end end
......
...@@ -85,9 +85,9 @@ def quoted_id ...@@ -85,9 +85,9 @@ def quoted_id
def test_quoting_binary_strings def test_quoting_binary_strings
value = "hello".encode('ascii-8bit') value = "hello".encode('ascii-8bit')
column = Column.new(nil, 1, SQLite3String.new) type = SQLite3String.new
assert_equal "'hello'", @conn.quote(value, column) assert_equal "'hello'", @conn.quote(type.type_cast_for_database(value))
end end
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册