Sha256: d278356a8556daed5e407559b23816c52beebad52d8554065e00beb5e23c4b6f

Contents?: true

Size: 460 Bytes

Versions: 21

Compression:

Stored size: 460 Bytes

Contents

require 'test_helper'

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

    assert_raise ArgumentError do
      coder.encode('xx')
    end
  end

  test 'decode' do
    assert_nil coder.decode('')
    assert_equal(0, coder.decode('abc'))
    assert_equal(3, coder.decode('3'))
    assert_equal(-3, coder.decode('-3'))
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
extendi-cassandra_object-1.1.1 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.1.0 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.20 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.19 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.18 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.17 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.16 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.15 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.14 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.13 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.12 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.11 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.10 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.9 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.8 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.7 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.6 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.5 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.4 test/unit/types/integer_type_test.rb
extendi-cassandra_object-1.0.1 test/unit/types/integer_type_test.rb