Sha256: 5c647e81931a9ae5a938fa4ab950e5579b30de67074bd3fa22452e9078bf7e91

Contents?: true

Size: 730 Bytes

Versions: 34

Compression:

Stored size: 730 Bytes

Contents

require 'spec_helper'

describe "setting up handles scopes" do
  include ExplicitScoper

  before do
    def self.instance_eval(*args, &block)
      V8::C::Locker() do
        cxt = V8::C::Context::New()
        begin
          cxt.Enter()
          super(*args, &block)
        ensure
          cxt.Exit()
        end
      end
    end
  end

  it "can allocate handle scopes" do
      V8::C::HandleScope() do
        V8::C::Object::New()
      end.class.should eql V8::C::Object
  end

  it "isn't the end of the world if a ruby exception is raised inside a HandleScope" do
    begin
      V8::C::HandleScope() do
        raise "boom!"
      end
    rescue StandardError => e
      e.message.should eql "boom!"
    end
  end
end

Version data entries

34 entries across 34 versions & 7 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/therubyracer-0.12.2/spec/c/handles_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.11.4/spec/c/handles_spec.rb
therubyracer-tmpfork-0.12.2 spec/c/handles_spec.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/therubyracer-0.12.2/spec/c/handles_spec.rb
therubyracer-0.12.2 spec/c/handles_spec.rb
therubyracer-0.12.1 spec/c/handles_spec.rb
therubyracer-discourse-0.12.0 spec/c/handles_spec.rb
therubyracer-0.12.0 spec/c/handles_spec.rb
therubyracer-0.11.4 spec/c/handles_spec.rb
therubyracer-0.11.3 spec/c/handles_spec.rb
therubyracer-0.11.2 spec/c/handles_spec.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/therubyracer-0.11.0/spec/c/handles_spec.rb
therubyracer-0.11.1 spec/c/handles_spec.rb
therubyracer-0.11.1beta1 spec/c/handles_spec.rb
therubyracer-0.11.0 spec/c/handles_spec.rb
therubyracer-0.11.0beta8-x86-freebsd-9 spec/c/handles_spec.rb
therubyracer-0.11.0beta8-x86_64-linux spec/c/handles_spec.rb
therubyracer-0.11.0beta8-x86-linux spec/c/handles_spec.rb
therubyracer-0.11.0beta8 spec/c/handles_spec.rb
therubyracer-0.11.0beta7-x86_64-linux spec/c/handles_spec.rb