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.1.1 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.1.0 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.20 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.19 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.18 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.17 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.16 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.15 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.14 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.13 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.12 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.11 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.10 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.9 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.8 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.7 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.6 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.5 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.4 test/unit/types/json_type_test.rb
extendi-cassandra_object-1.0.1 test/unit/types/json_type_test.rb