Sha256: bdf2af60d2700b94daad579addc4dea0331788126065248f93b010df4ff1f0d8

Contents?: true

Size: 552 Bytes

Versions: 35

Compression:

Stored size: 552 Bytes

Contents

require 'test_helper'

class CassandraObject::Types::JsonTypeTest < CassandraObject::Types::TestCase
  test 'encode' do
    assert_equal({a: 'b'}.to_json, coder.encode(a: 'b'))
    assert_equal '-3', coder.encode(-3)
  end

  test 'decode' do
    assert_equal({'a' => 'b'}, coder.decode({'a' => 'b'}.to_json))
  end

  test 'encode array' do
    assert_equal(['a', 'b'].to_json, coder.encode(['a', 'b']))
    assert_equal '-3', coder.encode(-3)
  end

  test 'decode array' do
    assert_equal(['a', 'b'], coder.decode(['a', 'b'].to_json))
  end


end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
extendi-cassandra_object-1.0.0 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.12.2 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.12.1 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.12.0 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.11.6 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.11.5 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.11.4 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.11.3 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.11.2 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.11.1 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.11.0 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.10.5 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.10.4 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.10.3 test/unit/types/json_type_test.rb
gotime-cassandra_object-4.10.2 test/unit/types/json_type_test.rb