Sha256: f83fbb8f9758a6e5c611664eb5d8372a7007494373931ddab391acd299307abf

Contents?: true

Size: 499 Bytes

Versions: 27

Compression:

Stored size: 499 Bytes

Contents

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

27 entries across 27 versions & 1 rubygems

Version Path
opal-1.7.4 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.7.3 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.7.2 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.7.1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.7.0 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.7.0.rc1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.6.1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.6.0 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.6.0.rc1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.6.0.alpha1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.5.1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.5.0 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.5.0.rc1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.4.1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.4.0 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.4.0.alpha1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.3.2 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.3.1 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.3.0 spec/opal/stdlib/native/native_writer_spec.rb
opal-1.3.0.rc1 spec/opal/stdlib/native/native_writer_spec.rb