Sha256: 2c59db5ba82b93329d50a32b1cbf86cd39aeb7f5a64c9458b8e8eb233c7b1f74

Contents?: true

Size: 536 Bytes

Versions: 6

Compression:

Stored size: 536 Bytes

Contents

# backtick_javascript: true

require 'native'

describe "Native#initialize" do
  it "works when Native is included in a BasicObject" do
    basic_class = Class.new(BasicObject)
    basic_object = basic_class.new
    lambda { basic_object.native? }.should raise_error(NoMethodError)

    basic_class.send :include, Native
    lambda { basic_class.new(`{}`) }.should_not raise_error
  end

  it "detects a non native object" do
    object = Object.new
    lambda { Native::Object.new(object) }.should raise_error(ArgumentError)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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