Sha256: eabf56d1f717d15e2e3f15a0dff6f86812109f3e8ac05a28faa683af2a34c5f8

Contents?: true

Size: 286 Bytes

Versions: 47

Compression:

Stored size: 286 Bytes

Contents

require 'native'

describe Struct do
  describe '#to_n' do
    it 'converts a struct with native attributes to a JS object' do
      klass = Struct.new(:attribute)
      obj = klass.new(`{ key: 1 }`)
      native = obj.to_n
      `#{native}.attribute.key`.should == 1
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

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