Sha256: 319bd7e18d758eb1675466f9e177acda4742f07bb4795e6828029b843eef4ad3

Contents?: true

Size: 744 Bytes

Versions: 1

Compression:

Stored size: 744 Bytes

Contents

require "test_helper"
require "active_record"

class ColumnWrapperTest < TestCase

  def test_wrap_should_return_instance_of_character_limited_column_for_string_column
    column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "varchar(255)")
    wrapped_column = Valle::AbstractAdapter::ColumnWrapper.wrap(column)

    assert wrapped_column.is_a?(Valle::AbstractAdapter::CharacterLimitedColumn)
  end

  def test_wrap_should_return_instance_of_byte_limited_column_for_int_column
    column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "int")
    wrapped_column = Valle::AbstractAdapter::ColumnWrapper.wrap(column)

    assert wrapped_column.is_a?(Valle::AbstractAdapter::ByteLimitedColumn)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
valle-1.0.1 test/lib/abstract_adapter/column_wrapper_test.rb