Sha256: b815b4983d3f0c6527aef98d872e683fba2c80970321eda82ac0c5e7f57a8bee

Contents?: true

Size: 591 Bytes

Versions: 21

Compression:

Stored size: 591 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 'encode as utf' do
    assert_equal(
      '123'.force_encoding('UTF-8').encoding,
      coder.encode('123'.force_encoding('ASCII-8BIT')).encoding
    )
  end

  test 'encode frozen as utf' do
    assert_equal(
      '123'.force_encoding('UTF-8').encoding,
      coder.encode('123'.force_encoding('ASCII-8BIT').freeze).encoding
    )
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

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