Sha256: ead967b76937163ae7b2c11a306dd7d9401fab5ccc7eeb2bb1caaace31b2ccaf

Contents?: true

Size: 540 Bytes

Versions: 8

Compression:

Stored size: 540 Bytes

Contents

# These operate on JS native objects, and might not be that useful from Opal
# Not converting these to work on ruby objects, as ruby standard library
# already has all relevant methods
describe "d3-collections - objects" do
  let(:object) { `{a: 1, b: 2, c: 3}` }

  it "d3.keys" do
    expect(D3.keys(object)).to eq(["a", "b", "c"])
  end

  it "d3.values" do
    expect(D3.values(object)).to eq([1, 2, 3])
  end

  it "d3.entries" do
    expect(D3.entries(object)).to eq([
       ["a",1],
       ["b",2],
       ["c",3],
    ])
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
hyper-d3-1.0.0.lap28 spec/objects_spec.rb
hyper-d3-1.0.0.lap27 spec/objects_spec.rb
hyper-d3-1.0.0.lap26 spec/objects_spec.rb
hyper-d3-1.0.0.lap25 spec/objects_spec.rb
hyper-d3-1.0.0.lap24 spec/objects_spec.rb
hyper-d3-1.0.0.lap23 spec/objects_spec.rb
opal-d3-0.0.20170822 spec/objects_spec.rb
opal-d3-0.0.20170205 spec/objects_spec.rb