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-2.2.23 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.22 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.20 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.18 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.16 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.14 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.12 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.10 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.8 test/types/integer_type_test.rb
sessionm-cassandra_object-2.2.6 test/types/integer_type_test.rb
gotime-cassandra_object-2.2.4 test/types/integer_type_test.rb
gotime-cassandra_object-2.2.3 test/types/integer_type_test.rb
gotime-cassandra_object-2.2.2 test/types/integer_type_test.rb
gotime-cassandra_object-2.2.1 test/types/integer_type_test.rb
gotime-cassandra_object-2.2.0 test/types/integer_type_test.rb
gotime-cassandra_object-2.1.2 test/types/integer_type_test.rb
gotime-cassandra_object-2.1.1 test/types/integer_type_test.rb
gotime-cassandra_object-2.1.0 test/types/integer_type_test.rb