Sha256: d98ebd649c647d32abf960813efafc612fe64f664daf28d5fdfdda40d54d2c5d

Contents?: true

Size: 546 Bytes

Versions: 5

Compression:

Stored size: 546 Bytes

Contents

require 'test_helper'

class Superstore::Types::IntegerTypeTest < Superstore::Types::TestCase
  if Superstore::Base.adapter.class.name == 'Superstore::Adapters::CassandraAdapter'
    test 'encode' do
      assert_equal '3', type.encode(3)
      assert_equal '-3', type.encode(-3)

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
superstore-2.4.4 test/unit/types/integer_type_test.rb
superstore-2.4.3 test/unit/types/integer_type_test.rb
superstore-2.4.2 test/unit/types/integer_type_test.rb
superstore-2.4.1 test/unit/types/integer_type_test.rb
superstore-2.4.0 test/unit/types/integer_type_test.rb