Sha256: 123f9e93672f4f4d334c835ef9ade23bff778fa8cfe4fd844feda3b33e823da6

Contents?: true

Size: 528 Bytes

Versions: 6

Compression:

Stored size: 528 Bytes

Contents

# backtick_javascript: true

require 'native'

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

      native_reader :a
      native_writer :a
    }.new(`{ a: 2 }`)

    n.a = 4
    n.a.should == 4
  end

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

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

    n.a = 4
    n.b = 5

    n.a.should == 4
    n.b.should == 5
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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