Sha256: 2f0d3a1310428e2d84ca64c9903ddce3c85f820a71f570ba6cbdb39deb9fe98a

Contents?: true

Size: 401 Bytes

Versions: 74

Compression:

Stored size: 401 Bytes

Contents

require 'native'

describe "Native::Object#[]" do
  it "should return the same value for bridged classes" do
    Native(`2`).should === 2
    Native(`"lol"`).should === "lol"
  end

  it "should return functions as is" do
    Native(`{ a: function(){} }`)[:a].should be_kind_of Proc
  end

  it "should wrap natives into a Native object" do
    Native(`{ a: { b: 2 } }`)[:a][:b].should == 2
  end
end

Version data entries

74 entries across 74 versions & 3 rubygems

Version Path
opal-0.7.0 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.7.0.rc1 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.7.0.beta3 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.6.3 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.7.0.beta2 spec/opal/stdlib/native/element_reference_spec.rb
opal-cj-0.7.0.beta2 spec/opal/stdlib/native/element_reference_spec.rb
opal-cj-0.7.0.beta1 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.7.0.beta1 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.6.2 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.6.1 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.6.0 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.5.5 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.5.4 spec/stdlib/native/element_reference_spec.rb
opal-0.5.2 spec/stdlib/native/element_reference_spec.rb