Sha256: ae7d0859e5b636b9d2aaa11673c612c534f3da6eb6bbff4f6add47142d959c41

Contents?: true

Size: 712 Bytes

Versions: 2

Compression:

Stored size: 712 Bytes

Contents

require 'test_helper'

class ColumnInfoTest < ActiveSupport::TestCase
  column_info = Ryakuzu::ColumnInfo.new
  test '#remove_extra_chars' do
    except = ['my_table_name']
    result = column_info.send(:remove_extra_chars, ["my_tab%$le_\sname"])
    assert_equal except, result
  end

  test '#column_and_type' do
    except = { table: 'products', type: 'boolean', column: 'accepted' }
    result = column_info.send(:column_and_type, %w(boolean accepted), 'products')
    assert_equal except, result
  end

  test '#make_hash' do
    hash   = %w(default 0 null false)
    except = { 'default' => '0', 'null' => 'false' }
    result = column_info.send(:make_hash, hash)
    assert_equal except, result
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ryakuzu-0.3.0 test/lib/column_info_test.rb
ryakuzu-0.2.6 test/lib/column_info_test.rb