Sha256: 8450603a21835a44857d1d9c7ce005dbba3512d2cb9ff2403ce6a95baf879a15

Contents?: true

Size: 546 Bytes

Versions: 97

Compression:

Stored size: 546 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

$: << File.dirname(__FILE__)

require 'helper'

class Hashi < Minitest::Test

  module TestModule
  end

  def test_dump
    h = Oj::EasyHash.new()
    h['abc'] = 3
    out = Oj.dump(h, :mode => :compat)
    assert_equal(%|{"abc":3}|, out)
  end

  def test_load
    obj = Oj.load(%|{"abc":3}|, :mode => :compat, :hash_class => Oj::EasyHash)
    
    assert_equal(Oj::EasyHash, obj.class)
    assert_equal(3, obj['abc'])
    assert_equal(3, obj[:abc])
    assert_equal(3, obj.abc())
  end
  
end # HashTest

Version data entries

97 entries across 97 versions & 2 rubygems

Version Path
oj-3.11.2 test/test_hash.rb
oj-3.11.1 test/test_hash.rb
oj-3.11.0 test/test_hash.rb
oj-3.10.18 test/test_hash.rb
oj-3.10.17 test/test_hash.rb
oj-3.10.16 test/test_hash.rb
oj-3.10.15 test/test_hash.rb
oj-3.10.14 test/test_hash.rb
oj-3.10.13 test/test_hash.rb
oj-3.10.12 test/test_hash.rb
oj-3.10.11 test/test_hash.rb
oj-3.10.10 test/test_hash.rb
oj-3.10.9 test/test_hash.rb
oj-3.10.8 test/test_hash.rb
oj-3.10.7 test/test_hash.rb
oj-3.10.6 test/test_hash.rb
oj-3.10.5 test/test_hash.rb
oj-3.10.3 test/test_hash.rb
oj-3.10.2 test/test_hash.rb
oj-3.10.1 test/test_hash.rb