Sha256: 65a864f81c3af442001dd17d70a77c35df213417c0a8c4e99f511e47b77cd9f1

Contents?: true

Size: 660 Bytes

Versions: 27

Compression:

Stored size: 660 Bytes

Contents

require 'test_helper'

class CassandraObject::Types::BaseTypeTest < CassandraObject::Types::TestCase
  test 'default' do
    assert_equal nil, coder.default
    assert_equal '5', CassandraObject::Types::BaseType.new(default: '5').default
    assert_equal 5.object_id, CassandraObject::Types::BaseType.new(default: 5).default.object_id
  end

  test 'encode' do
    assert_equal '1', coder.encode(1)
    assert_equal '', coder.encode(nil)
    assert_equal '1', coder.encode('1')
  end

  test 'decode' do
    assert_equal 'abc', coder.decode('abc')
  end

  test 'wrap' do
    object = Object.new
    assert_equal object, coder.wrap(nil, nil, object)
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
gotime-cassandra_object-4.8.1 test/unit/types/base_type_test.rb
gotime-cassandra_object-4.8.0 test/unit/types/base_type_test.rb
gotime-cassandra_object-4.7.3 test/unit/types/base_type_test.rb
gotime-cassandra_object-4.7.2 test/unit/types/base_type_test.rb
gotime-cassandra_object-4.7.1 test/unit/types/base_type_test.rb
gotime-cassandra_object-4.7.0 test/unit/types/base_type_test.rb
gotime-cassandra_object-4.6.0 test/unit/types/base_type_test.rb