Sha256: bbc9667de1fc882cb83b2c7e21fad8045bd94cc642ff99a850338503e596e84f

Contents?: true

Size: 315 Bytes

Versions: 6

Compression:

Stored size: 315 Bytes

Contents

# backtick_javascript: true

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

6 entries across 6 versions & 1 rubygems

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