Sha256: 6f0b2aebfd29ae6cf9a1c3b87a63a8ff6952f63b74aa3cfc7efa98a1fe0bee87

Contents?: true

Size: 834 Bytes

Versions: 7

Compression:

Stored size: 834 Bytes

Contents

require 'abstract_unit'
require 'fixtures/reference_type'
require 'fixtures/reference_code'

class CompositeArraysTest < ActiveSupport::TestCase

  def test_new_primary_keys
    keys = CompositePrimaryKeys::CompositeKeys.new
    assert_not_nil keys
    assert_equal '', keys.to_s
    assert_equal '', "#{keys}"
  end

  def test_initialize_primary_keys
    keys = CompositePrimaryKeys::CompositeKeys.new([1,2,3])
    assert_not_nil keys
    assert_equal '1,2,3', keys.to_s
    assert_equal '1,2,3', "#{keys}"
  end
  
  def test_to_composite_keys
    keys = [1,2,3].to_composite_keys
    assert_equal CompositePrimaryKeys::CompositeKeys, keys.class
    assert_equal '1,2,3', keys.to_s
  end

  def test_to_composite_ids
    keys = [1,2,3].to_composite_ids
    assert_equal Array, keys.class
    assert_equal '123', keys.to_s
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
composite_primary_keys-3.0.9 test/test_composite_arrays.rb
composite_primary_keys-3.0.8 test/test_composite_arrays.rb
composite_primary_keys-3.0.7 test/test_composite_arrays.rb
composite_primary_keys-3.0.4 test/test_composite_arrays.rb
composite_primary_keys-3.0.3 test/test_composite_arrays.rb
composite_primary_keys-3.0.0.b3 test/test_composite_arrays.rb
composite_primary_keys-3.0.0.b2 test/test_composite_arrays.rb