Sha256: 6d66c83ec2fd09f27eb400cab6ab0d405051d6c56ed9580a62ef844e9253415f

Contents?: true

Size: 477 Bytes

Versions: 3

Compression:

Stored size: 477 Bytes

Contents

require 'native'

describe Hash do
  it 'turns a native JS object into a hash' do
    obj = %x{
      {
        a: 1,
        b: "two",
        c: {
          d: 1,
        },
        e: [
          {
            f: 'g',
          },
        ],
      }
    }

    h = Hash.new(obj)
    expected_hash = {
      a: 1,
      b: "two",
      c: {
        d: 1,
      },
      e: [
        {
          f: 'g',
        },
      ],
    }

    expect(h).to eq(expected_hash)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-0.9.0.rc1 spec/opal/stdlib/native/hash_spec.rb
opal-0.9.0.beta2 spec/opal/stdlib/native/hash_spec.rb
opal-0.9.0.beta1 spec/opal/stdlib/native/hash_spec.rb