Sha256: b0435b6a4cd505b7f3976055857019f038df7d275c95306065cb5d75ea04909e

Contents?: true

Size: 426 Bytes

Versions: 6

Compression:

Stored size: 426 Bytes

Contents

# backtick_javascript: true

require 'native'

describe "Native.native_reader" do
  it "refers to an attribute on @native" do
    Class.new {
      include Native::Wrapper

      native_reader :a
    }.new(`{ a: 2 }`).a.should == 2
  end

  it "uses multiple names" do
    n = Class.new {
      include Native::Wrapper

      native_reader :a, :b
    }.new(`{ a: 2, b: 3 }`)

    n.a.should == 2
    n.b.should == 3
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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