Sha256: 2dfbe637a6589c131c3d77fd67277e2e6a0dfe9e2ae0895c89cf4cc31a2aa070

Contents?: true

Size: 587 Bytes

Versions: 118

Compression:

Stored size: 587 Bytes

Contents

require 'test_helper'

class CassandraObject::Types::IntegerTypeTest < CassandraObject::TestCase
  test 'encode' do
    assert_equal '3', CassandraObject::Types::IntegerType.encode(3)
    assert_equal '-3', CassandraObject::Types::IntegerType.encode(-3)

    assert_raise ArgumentError do
      CassandraObject::Types::BooleanType.encode('xx')
    end
  end

  test 'decode' do
    assert_nil CassandraObject::Types::IntegerType.decode('')
    assert_equal 3, CassandraObject::Types::IntegerType.decode('3')
    assert_equal -3, CassandraObject::Types::IntegerType.decode('-3')
  end
end

Version data entries

118 entries across 118 versions & 2 rubygems

Version Path
sessionm-cassandra_object-4.0.32 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.31 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.30 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.29 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.28 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.27 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.26 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.25 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.24 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.23 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.22 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.21 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.20 test/types/integer_type_test.rb
sessionm-cassandra_object-2.7.5 test/types/integer_type_test.rb
sessionm-cassandra_object-2.7.4 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.18 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.17 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.16 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.15 test/types/integer_type_test.rb
sessionm-cassandra_object-4.0.14 test/types/integer_type_test.rb