Sha256: f2bfc5f479bfcf6c32fa26caba41221d4e3e6e4a660b97b9feec1efc9208754f

Contents?: true

Size: 430 Bytes

Versions: 6

Compression:

Stored size: 430 Bytes

Contents

# backtick_javascript: true

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

6 entries across 6 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.8.2 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.8.1 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.8.0 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.8.0.beta1 spec/opal/stdlib/native/element_reference_spec.rb
opal-1.8.0.alpha1 spec/opal/stdlib/native/element_reference_spec.rb