Sha256: c641b58fe98c31943c78cfb9d1e1d04e6ec24ffc06d504ea534155a54ec394fa

Contents?: true

Size: 645 Bytes

Versions: 3

Compression:

Stored size: 645 Bytes

Contents

require 'spec_helper'

describe "setting up handles scopes" do
  around(:each) do |example|
    V8::C::Locker() do
      cxt = V8::C::Context::New()
      begin
        cxt.Enter()
        example.run
      ensure
        cxt.Exit()
      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

3 entries across 3 versions & 2 rubygems

Version Path
therubyracer-0.12.3 spec/c/handles_spec.rb
therubyracer-xcode-0.12.3 spec/c/handles_spec.rb
therubyracer-xcode-0.12.2 spec/c/handles_spec.rb