Sha256: 9ea7e6ac632dfd7c0b860afb43f650beac1394fc231777d3d848d15fb89581a4

Contents?: true

Size: 542 Bytes

Versions: 4

Compression:

Stored size: 542 Bytes

Contents

require 'test_helper'

class Superstore::Types::JsonTypeTest < Superstore::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

4 entries across 4 versions & 1 rubygems

Version Path
superstore-1.0.4 test/unit/types/json_type_test.rb
superstore-1.0.3 test/unit/types/json_type_test.rb
superstore-1.0.2 test/unit/types/json_type_test.rb
superstore-1.0.0 test/unit/types/json_type_test.rb