Sha256: 6dff8fdbeb38a0c13ea76a813bd7ae829b987e7634489e176093d30ec2cf4c31

Contents?: true

Size: 802 Bytes

Versions: 3

Compression:

Stored size: 802 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", "", ::ActiveRecord::Type::String.new(limit: 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", 25, ::ActiveRecord::Type::Integer.new)
    wrapped_column = Valle::AbstractAdapter::ColumnWrapper.wrap(column)

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
valle-1.1.2 test/lib/abstract_adapter/column_wrapper_test.rb
valle-1.1.1 test/lib/abstract_adapter/column_wrapper_test.rb
valle-1.1.0 test/lib/abstract_adapter/column_wrapper_test.rb