Sha256: 28602a9692b0d8ef14beffa51411d04e16e4a59d43da8b624488c0da8c325f9e

Contents?: true

Size: 481 Bytes

Versions: 43

Compression:

Stored size: 481 Bytes

Contents

require 'native'

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

      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

      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

43 entries across 43 versions & 3 rubygems

Version Path
opal-0.10.6 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.6.beta spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.5 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.4 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.11.0.rc1 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.3 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.2 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.1 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.0 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.0.rc2 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.9.4 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.9.3 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.0.rc1 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.0.beta5 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.0.beta4 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.0.beta3 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.0.beta2 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.10.0.beta1 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.9.2 spec/opal/stdlib/native/native_writer_spec.rb
opal-0.9.0 spec/opal/stdlib/native/native_writer_spec.rb