Sha256: 00686d00df8d629e354e3bf60c4c7dcb0cd4a4dfaf58df5a87f706a3a9a15054

Contents?: true

Size: 738 Bytes

Versions: 8

Compression:

Stored size: 738 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", "", "string")
    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

8 entries across 8 versions & 1 rubygems

Version Path
valle-1.0.0 test/lib/abstract_adapter/column_wrapper_test.rb
valle-0.2.3 test/lib/abstract_adapter/column_wrapper_test.rb
valle-0.2.2 test/lib/abstract_adapter/column_wrapper_test.rb
valle-0.2.1 test/lib/abstract_adapter/column_wrapper_test.rb
valle-0.2.0 test/lib/abstract_adapter/column_wrapper_test.rb
valle-0.1.0 test/lib/abstract_adapter/column_wrapper_test.rb
valle-0.0.3 test/lib/abstract_adapter/column_wrapper_test.rb
valle-0.0.2 test/lib/abstract_adapter/column_wrapper_test.rb