Sha256: 7c5428fe33208c4e310d25d04a48258b2e77fba03a2a2a6d52ac2edfd3f85ff8

Contents?: true

Size: 593 Bytes

Versions: 27

Compression:

Stored size: 593 Bytes

Contents

require 'test_helper'

class CassandraObject::Types::StringTypeTest < CassandraObject::Types::TestCase
  test 'encode' do
    assert_equal 'abc', coder.encode('abc')

    assert_raise ArgumentError do
      coder.encode(123)
    end
  end

  test 'wrap' do
    assert_equal(
      '123'.force_encoding('UTF-8').encoding,
      coder.wrap(nil, nil, '123'.force_encoding('ASCII-8BIT')).encoding
    )
  end

  test 'wrap when frozen' do
    assert_equal(
      '123'.force_encoding('UTF-8').encoding,
      coder.wrap(nil, nil, '123'.force_encoding('ASCII-8BIT').freeze).encoding
    )
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.10.6 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.10.5 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.10.4 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.10.3 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.10.2 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.10.1 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.10.0 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.9.2 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.9.1 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.9.0 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.8.6 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.8.5 test/unit/types/string_type_test.rb
gotime-cassandra_object-2.8.4 test/types/string_type_test.rb
gotime-cassandra_object-2.8.3 test/types/string_type_test.rb
gotime-cassandra_object-2.8.2 test/types/string_type_test.rb
gotime-cassandra_object-2.8.1 test/types/string_type_test.rb
gotime-cassandra_object-2.8.0 test/types/string_type_test.rb
gotime-cassandra_object-2.7.12 test/types/string_type_test.rb
gotime-cassandra_object-2.7.11 test/types/string_type_test.rb
gotime-cassandra_object-2.7.10 test/types/string_type_test.rb