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-1.3.0.alpha1 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.2.0 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.2.0.beta1 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.1.1 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.1.1.rc1 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.1.0 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.1.0.rc1 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.6 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.6.beta spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.5 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.4 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.11.0.rc1 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.3 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.2 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.1 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.0 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.0.rc2 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.9.4 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.9.3 spec/opal/stdlib/native/element_reference_spec.rb
opal-0.10.0.rc1 spec/opal/stdlib/native/element_reference_spec.rb