aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/mysql/sql_types_test.rb
blob: 25b28de7f0e1377acbb8c33389d36a9d9c7061e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require "cases/helper"

class MysqlSqlTypesTest < ActiveRecord::MysqlTestCase
  def test_binary_types
    assert_equal 'varbinary(64)', type_to_sql(:binary, 64)
    assert_equal 'varbinary(4095)', type_to_sql(:binary, 4095)
    assert_equal 'blob(4096)', type_to_sql(:binary, 4096)
    assert_equal 'blob', type_to_sql(:binary)
  end

  def type_to_sql(*args)
    ActiveRecord::Base.connection.type_to_sql(*args)
  end
end